From 4b7a583b338a03fc098780e71ac09242f729a7e5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 12 May 2018 00:15:24 +0800 Subject: [PATCH] Update Swift default value (#407) * update swift4 default * update swift3 default value * update swift default value --- bin/swift-petstore-promisekit.json | 4 +- bin/swift-petstore-rxswift.json | 2 +- bin/swift3-petstore-objcCompatible.json | 4 +- bin/swift3-petstore-promisekit.json | 4 +- bin/swift3-petstore-rxswift.json | 2 +- bin/swift3-petstore-unwraprequired.json | 4 +- bin/swift3-petstore.json | 4 +- bin/swift4-petstore-objcCompatible.json | 4 +- bin/swift4-petstore-promisekit.json | 4 +- bin/swift4-petstore-rxswift.json | 2 +- bin/swift4-petstore.json | 4 +- bin/swift4-test.json | 4 +- .../codegen/languages/Swift3Codegen.java | 115 +++--- .../codegen/languages/Swift4Codegen.java | 182 ++++----- .../codegen/languages/SwiftClientCodegen.java | 134 +++---- .../swift/AlamofireImplementations.mustache | 2 - .../src/main/resources/swift/Models.mustache | 2 +- .../src/main/resources/swift/Podspec.mustache | 2 +- .../swift3/AlamofireImplementations.mustache | 2 - .../main/resources/swift3/Podspec.mustache | 2 +- .../main/resources/swift4/Podspec.mustache | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 7 +- .../swift/default/.openapi-generator/VERSION | 2 +- .../swift/default/PetstoreClient.podspec | 2 +- .../{Swaggers => OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 166 ++++---- .../APIs/StoreAPI.swift | 38 +- .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 82 ++-- .../OpenAPIs}/AlamofireImplementations.swift | 10 +- .../Classes/OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 6 +- .../Models/Category.swift | 4 +- .../Classes/OpenAPIs}/Models/Order.swift | 4 +- .../Classes/OpenAPIs}/Models/Pet.swift | 4 +- .../Classes/OpenAPIs}/Models/Tag.swift | 4 +- .../Classes/OpenAPIs}/Models/User.swift | 4 +- .../client/petstore/swift/default/git_push.sh | 2 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../swift/promisekit/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 180 ++++----- .../APIs/StoreAPI.swift | 44 +- .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 106 ++--- .../OpenAPIs}/AlamofireImplementations.swift | 10 +- .../{Swaggers => OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 6 +- .../Models/Category.swift | 4 +- .../Classes/OpenAPIs}/Models/Order.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Pet.swift | 4 +- .../Classes/OpenAPIs}/Models/Tag.swift | 4 +- .../Classes/OpenAPIs}/Models/User.swift | 4 +- .../petstore/swift/promisekit/git_push.sh | 2 +- .../swift/rxswift/.openapi-generator/VERSION | 2 +- .../swift/rxswift/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 180 ++++----- .../APIs/StoreAPI.swift | 44 +- .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 106 ++--- .../OpenAPIs}/AlamofireImplementations.swift | 10 +- .../Classes/OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 6 +- .../Models/Category.swift | 4 +- .../Classes/OpenAPIs}/Models/Order.swift | 4 +- .../Classes/OpenAPIs}/Models/Pet.swift | 4 +- .../Classes/OpenAPIs}/Models/Tag.swift | 4 +- .../Classes/OpenAPIs}/Models/User.swift | 4 +- .../client/petstore/swift/rxswift/git_push.sh | 2 +- .../swift3/default/.openapi-generator/VERSION | 2 +- .../swift3/default/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../OpenAPIs}/APIs/AnotherFakeAPI.swift | 17 +- .../Classes/OpenAPIs}/APIs/FakeAPI.swift | 138 +++---- .../APIs/FakeClassnameTags123API.swift | 16 +- .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 209 ++++------ .../APIs/StoreAPI.swift | 71 ++-- .../Classes/OpenAPIs}/APIs/UserAPI.swift | 98 ++--- .../OpenAPIs}/AlamofireImplementations.swift | 6 +- .../Classes/OpenAPIs}/Configuration.swift | 4 +- .../Classes/OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 195 ++++----- .../Models/AdditionalPropertiesClass.swift | 4 +- .../Models/Animal.swift | 4 +- .../Classes/OpenAPIs}/Models/AnimalFarm.swift | 0 .../OpenAPIs}/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 4 +- .../OpenAPIs}/Models/ArrayOfNumberOnly.swift | 4 +- .../Models/ArrayTest.swift | 4 +- .../Models/Capitalization.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Cat.swift | 4 +- .../Classes/OpenAPIs}/Models/Category.swift | 4 +- .../Models/ClassModel.swift | 4 +- .../Classes/OpenAPIs}/Models/Client.swift | 4 +- .../Classes/OpenAPIs}/Models/Dog.swift | 4 +- .../Models/EnumArrays.swift | 4 +- .../Classes/OpenAPIs}/Models/EnumClass.swift | 4 +- .../Classes/OpenAPIs}/Models/EnumTest.swift | 4 +- .../Models/FormatTest.swift | 6 +- .../OpenAPIs}/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs}/Models/List.swift | 8 +- .../Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 4 +- .../OpenAPIs}/Models/Model200Response.swift | 4 +- .../Classes/OpenAPIs}/Models/Name.swift | 8 +- .../Models/NumberOnly.swift | 4 +- .../Classes/OpenAPIs}/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 30 ++ .../Classes/OpenAPIs}/Models/OuterEnum.swift | 4 +- .../Classes/OpenAPIs}/Models/Pet.swift | 4 +- .../Models/ReadOnlyFirst.swift | 4 +- .../Models/Return.swift | 4 +- .../Models/SpecialModelName.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Tag.swift | 4 +- .../Classes/OpenAPIs}/Models/User.swift | 4 +- .../APIs/Fake_classname_tags123API.swift | 49 --- .../Swaggers/APIs/FakeclassnametagsAPI.swift | 49 --- .../Swaggers/Models/OuterBoolean.swift | 24 -- .../Swaggers/Models/OuterComposite.swift | 30 -- .../Classes/Swaggers/Models/OuterNumber.swift | 24 -- .../Classes/Swaggers/Models/OuterString.swift | 24 -- .../petstore/swift3/default/git_push.sh | 2 +- .../objcCompatible/.openapi-generator/VERSION | 2 +- .../objcCompatible/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../OpenAPIs}/APIs/AnotherFakeAPI.swift | 17 +- .../Classes/OpenAPIs}/APIs/FakeAPI.swift | 138 +++---- .../APIs/FakeClassnameTags123API.swift | 16 +- .../Classes/OpenAPIs}/APIs/PetAPI.swift | 209 ++++------ .../APIs/StoreAPI.swift | 71 ++-- .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 98 ++--- .../OpenAPIs}/AlamofireImplementations.swift | 6 +- .../Classes/OpenAPIs}/Configuration.swift | 4 +- .../Classes/OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 195 ++++----- .../Models/AdditionalPropertiesClass.swift | 4 +- .../Models/Animal.swift | 4 +- .../Classes/OpenAPIs}/Models/AnimalFarm.swift | 4 +- .../Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 4 +- .../OpenAPIs}/Models/ArrayOfNumberOnly.swift | 4 +- .../Models/ArrayTest.swift | 4 +- .../Models/Capitalization.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Cat.swift | 4 +- .../Models/Category.swift | 4 +- .../Models/ClassModel.swift | 4 +- .../Classes/OpenAPIs}/Models/Client.swift | 4 +- .../Classes/OpenAPIs}/Models/Dog.swift | 4 +- .../Models/EnumArrays.swift | 4 +- .../Models/EnumClass.swift | 4 +- .../Classes/OpenAPIs}/Models/EnumTest.swift | 4 +- .../Models/FormatTest.swift | 11 +- .../OpenAPIs}/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs}/Models/List.swift | 8 +- .../Classes/OpenAPIs}/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 4 +- .../Models/Model200Response.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Name.swift | 12 +- .../Classes/OpenAPIs}/Models/NumberOnly.swift | 9 +- .../{Swaggers => OpenAPIs}/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 30 ++ .../Models/OuterEnum.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Pet.swift | 4 +- .../OpenAPIs}/Models/ReadOnlyFirst.swift | 4 +- .../Models/Return.swift | 4 +- .../Models/SpecialModelName.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Tag.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/User.swift | 4 +- .../APIs/Fake_classname_tags123API.swift | 49 --- .../Swaggers/Models/OuterBoolean.swift | 24 -- .../Swaggers/Models/OuterComposite.swift | 30 -- .../Classes/Swaggers/Models/OuterNumber.swift | 24 -- .../Classes/Swaggers/Models/OuterString.swift | 24 -- .../swift3/objcCompatible/git_push.sh | 2 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../swift3/promisekit/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../APIs/AnotherFakeAPI.swift | 23 +- .../{Swaggers => OpenAPIs}/APIs/FakeAPI.swift | 182 ++++----- .../APIs/FakeClassnameTags123API.swift | 22 +- .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 221 ++++------ .../APIs/StoreAPI.swift | 77 ++-- .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 122 +++--- .../OpenAPIs}/AlamofireImplementations.swift | 6 +- .../Classes/OpenAPIs}/Configuration.swift | 4 +- .../{Swaggers => OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 195 ++++----- .../Models/AdditionalPropertiesClass.swift | 4 +- .../Models/Animal.swift | 4 +- .../Models/AnimalFarm.swift | 4 +- .../OpenAPIs}/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 4 +- .../OpenAPIs}/Models/ArrayOfNumberOnly.swift | 4 +- .../Models/ArrayTest.swift | 4 +- .../Models/Capitalization.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Cat.swift | 4 +- .../Classes/OpenAPIs}/Models/Category.swift | 4 +- .../Models/ClassModel.swift | 4 +- .../Classes/OpenAPIs}/Models/Client.swift | 4 +- .../Classes/OpenAPIs}/Models/Dog.swift | 4 +- .../Models/EnumArrays.swift | 4 +- .../Classes/OpenAPIs}/Models/EnumClass.swift | 4 +- .../Models/EnumTest.swift | 4 +- .../Models/FormatTest.swift | 6 +- .../OpenAPIs}/Models/HasOnlyReadOnly.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/List.swift | 8 +- .../Classes/OpenAPIs}/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 4 +- .../OpenAPIs}/Models/Model200Response.swift | 4 +- .../Classes/OpenAPIs}/Models/Name.swift | 8 +- .../Classes/OpenAPIs}/Models/NumberOnly.swift | 4 +- .../Classes/OpenAPIs}/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 30 ++ .../Classes/OpenAPIs}/Models/OuterEnum.swift | 4 +- .../Classes/OpenAPIs}/Models/Pet.swift | 4 +- .../OpenAPIs}/Models/ReadOnlyFirst.swift | 4 +- .../Models/Return.swift | 4 +- .../Models/SpecialModelName.swift | 4 +- .../Classes/OpenAPIs}/Models/Tag.swift | 4 +- .../Classes/OpenAPIs}/Models/User.swift | 4 +- .../APIs/Fake_classname_tags123API.swift | 66 --- .../Swaggers/APIs/FakeclassnametagsAPI.swift | 67 ---- .../Swaggers/Models/OuterBoolean.swift | 24 -- .../Swaggers/Models/OuterComposite.swift | 30 -- .../Classes/Swaggers/Models/OuterNumber.swift | 24 -- .../Classes/Swaggers/Models/OuterString.swift | 24 -- .../petstore/swift3/promisekit/git_push.sh | 2 +- .../swift3/rxswift/.openapi-generator/VERSION | 2 +- .../swift3/rxswift/PetstoreClient.podspec | 4 +- .../{Swaggers => OpenAPIs}/APIHelper.swift | 4 +- .../Classes/OpenAPIs}/APIs.swift | 4 +- .../APIs/AnotherFakeAPI.swift | 23 +- .../{Swaggers => OpenAPIs}/APIs/FakeAPI.swift | 176 ++++---- .../APIs/FakeClassnameTags123API.swift | 22 +- .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 221 ++++------ .../APIs/StoreAPI.swift | 77 ++-- .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 122 +++--- .../OpenAPIs}/AlamofireImplementations.swift | 6 +- .../Configuration.swift | 4 +- .../{Swaggers => OpenAPIs}/Extensions.swift | 4 +- .../Classes/OpenAPIs}/Models.swift | 195 ++++----- .../Models/AdditionalPropertiesClass.swift | 4 +- .../Models/Animal.swift | 4 +- .../Models/AnimalFarm.swift | 4 +- .../Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 4 +- .../Models/ArrayOfNumberOnly.swift | 4 +- .../Models/ArrayTest.swift | 4 +- .../Models/Capitalization.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Cat.swift | 4 +- .../Classes/OpenAPIs}/Models/Category.swift | 4 +- .../Models/ClassModel.swift | 4 +- .../Classes/OpenAPIs}/Models/Client.swift | 4 +- .../Classes/OpenAPIs}/Models/Dog.swift | 4 +- .../Models/EnumArrays.swift | 4 +- .../Models/EnumClass.swift | 4 +- .../Models/EnumTest.swift | 4 +- .../Models/FormatTest.swift | 6 +- .../Models/HasOnlyReadOnly.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/List.swift | 8 +- .../Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 4 +- .../OpenAPIs}/Models/Model200Response.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Name.swift | 8 +- .../Classes/OpenAPIs}/Models/NumberOnly.swift | 4 +- .../Classes/OpenAPIs}/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 30 ++ .../Classes/OpenAPIs}/Models/OuterEnum.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Pet.swift | 4 +- .../OpenAPIs}/Models/ReadOnlyFirst.swift | 4 +- .../Models/Return.swift | 4 +- .../Models/SpecialModelName.swift | 4 +- .../Classes/OpenAPIs}/Models/Tag.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/User.swift | 4 +- .../APIs/Fake_classname_tags123API.swift | 68 ---- .../Swaggers/Models/OuterBoolean.swift | 24 -- .../Swaggers/Models/OuterComposite.swift | 30 -- .../Classes/Swaggers/Models/OuterNumber.swift | 24 -- .../Classes/Swaggers/Models/OuterString.swift | 24 -- .../petstore/swift3/rxswift/git_push.sh | 2 +- .../unwraprequired/.openapi-generator/VERSION | 2 +- .../unwraprequired/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 75 ++++ .../Classes/OpenAPIs/APIs.swift | 77 ++++ .../OpenAPIs/APIs/AnotherFakeAPI.swift} | 17 +- .../Classes/OpenAPIs}/APIs/FakeAPI.swift | 138 +++---- .../APIs/FakeClassnameTags123API.swift | 16 +- .../Classes/OpenAPIs}/APIs/PetAPI.swift | 209 ++++------ .../APIs/StoreAPI.swift | 71 ++-- .../Classes/OpenAPIs}/APIs/UserAPI.swift | 98 ++--- .../OpenAPIs/AlamofireImplementations.swift | 374 +++++++++++++++++ .../Classes/OpenAPIs/Configuration.swift | 15 + .../Classes/OpenAPIs}/Extensions.swift | 4 +- .../{Swaggers => OpenAPIs}/Models.swift | 167 +++----- .../Models/AdditionalPropertiesClass.swift | 4 +- .../Models/Animal.swift | 4 +- .../Classes/OpenAPIs}/Models/AnimalFarm.swift | 4 +- .../Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 4 +- .../Models/ArrayOfNumberOnly.swift | 4 +- .../Models/ArrayTest.swift | 4 +- .../Models/Capitalization.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Cat.swift | 4 +- .../Models/Category.swift | 4 +- .../Models/ClassModel.swift | 4 +- .../Models/Client.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Dog.swift | 4 +- .../Models/EnumArrays.swift | 4 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 17 + .../Models/EnumTest.swift | 4 +- .../Models/FormatTest.swift | 8 +- .../Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 28 ++ .../Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 4 +- .../Models/Model200Response.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Name.swift | 12 +- .../Models/NumberOnly.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 34 ++ .../Classes/OpenAPIs/Models/OuterEnum.swift | 17 + .../{Swaggers => OpenAPIs}/Models/Pet.swift | 4 +- .../Models/ReadOnlyFirst.swift | 4 +- .../Models/Return.swift | 4 +- .../Models/SpecialModelName.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/Tag.swift | 4 +- .../{Swaggers => OpenAPIs}/Models/User.swift | 4 +- .../Classes/Swaggers/APIHelper.swift | 75 ---- .../Classes/Swaggers/APIs.swift | 77 ---- .../APIs/Fake_classname_tags123API.swift | 49 --- .../Swaggers/AlamofireImplementations.swift | 376 ------------------ .../Classes/Swaggers/Configuration.swift | 15 - .../Classes/Swaggers/Models/AnimalFarm.swift | 11 - .../Classes/Swaggers/Models/EnumClass.swift | 17 - .../Classes/Swaggers/Models/List.swift | 28 -- .../Swaggers/Models/OuterBoolean.swift | 25 -- .../Swaggers/Models/OuterComposite.swift | 34 -- .../Classes/Swaggers/Models/OuterEnum.swift | 17 - .../Classes/Swaggers/Models/OuterNumber.swift | 25 -- .../Classes/Swaggers/Models/OuterString.swift | 25 -- .../swift3/unwraprequired/git_push.sh | 2 +- .../swift4/default/PetstoreClient.podspec | 4 +- .../{Swaggers => OpenAPIs}/APIHelper.swift | 0 .../Classes/{Swaggers => OpenAPIs}/APIs.swift | 0 .../APIs/AnotherFakeAPI.swift} | 0 .../{Swaggers => OpenAPIs}/APIs/FakeAPI.swift | 0 .../APIs/FakeClassnameTags123API.swift | 0 .../{Swaggers => OpenAPIs}/APIs/PetAPI.swift | 0 .../APIs/StoreAPI.swift | 0 .../{Swaggers => OpenAPIs}/APIs/UserAPI.swift | 0 .../AlamofireImplementations.swift | 0 .../CodableHelper.swift | 0 .../Configuration.swift | 0 .../{Swaggers => OpenAPIs}/Extensions.swift | 0 .../JSONEncodableEncoding.swift | 0 .../JSONEncodingHelper.swift | 0 .../{Swaggers => OpenAPIs}/Models.swift | 0 .../Models/AdditionalPropertiesClass.swift | 0 .../Models/Animal.swift | 0 .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 + .../Models/ApiResponse.swift | 0 .../Models/ArrayOfArrayOfNumberOnly.swift | 0 .../Models/ArrayOfNumberOnly.swift | 0 .../Models/ArrayTest.swift | 0 .../Models/Capitalization.swift | 0 .../{Swaggers => OpenAPIs}/Models/Cat.swift | 0 .../Models/Category.swift | 0 .../Models/ClassModel.swift | 0 .../Models/Client.swift | 0 .../{Swaggers => OpenAPIs}/Models/Dog.swift | 0 .../Models/EnumArrays.swift | 0 .../Models/EnumClass.swift | 0 .../Models/EnumTest.swift | 0 .../Models/FormatTest.swift | 0 .../Models/HasOnlyReadOnly.swift | 0 .../{Swaggers => OpenAPIs}/Models/List.swift | 0 .../Models/MapTest.swift | 0 ...opertiesAndAdditionalPropertiesClass.swift | 0 .../Models/Model200Response.swift | 0 .../{Swaggers => OpenAPIs}/Models/Name.swift | 0 .../Models/NumberOnly.swift | 0 .../{Swaggers => OpenAPIs}/Models/Order.swift | 0 .../Models/OuterComposite.swift | 0 .../Models/OuterEnum.swift | 0 .../{Swaggers => OpenAPIs}/Models/Pet.swift | 0 .../Models/ReadOnlyFirst.swift | 0 .../Models/Return.swift | 0 .../Models/SpecialModelName.swift | 0 .../{Swaggers => OpenAPIs}/Models/Tag.swift | 0 .../{Swaggers => OpenAPIs}/Models/User.swift | 0 .../APIs/Fake_classname_tags123API.swift | 54 --- .../Swaggers/Models/OuterBoolean.swift | 18 - .../Classes/Swaggers/Models/OuterNumber.swift | 18 - .../Classes/Swaggers/Models/OuterString.swift | 18 - 398 files changed, 3466 insertions(+), 5252 deletions(-) rename samples/client/petstore/swift/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIHelper.swift (94%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (86%) rename samples/client/petstore/swift/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (84%) rename samples/client/petstore/swift/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (80%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (95%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models.swift (98%) rename samples/client/petstore/swift/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Category.swift (86%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Order.swift (92%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Pet.swift (92%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Tag.swift (86%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/User.swift (92%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/APIHelper.swift (94%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (87%) rename samples/client/petstore/swift/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (85%) rename samples/client/petstore/swift/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (81%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (95%) rename samples/client/petstore/swift/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models.swift (98%) rename samples/client/petstore/swift/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Category.swift (86%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Order.swift (92%) rename samples/client/petstore/swift/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Pet.swift (92%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Tag.swift (86%) rename samples/client/petstore/swift/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/User.swift (92%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/APIHelper.swift (94%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (88%) rename samples/client/petstore/swift/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (85%) rename samples/client/petstore/swift/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (82%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (95%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models.swift (98%) rename samples/client/petstore/swift/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Category.swift (86%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Order.swift (92%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Pet.swift (92%) rename samples/client/petstore/swift/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Tag.swift (86%) rename samples/client/petstore/swift/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/User.swift (92%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/APIHelper.swift (96%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift3/{unwraprequired/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/APIs/AnotherFakeAPI.swift (63%) rename samples/client/petstore/swift3/{unwraprequired/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/APIs/FakeAPI.swift (75%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeClassnameTags123API.swift (66%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (84%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (85%) rename samples/client/petstore/swift3/{unwraprequired/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/APIs/UserAPI.swift (83%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (98%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Configuration.swift (80%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models.swift (95%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AdditionalPropertiesClass.swift (88%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Animal.swift (86%) rename samples/client/petstore/{swift4/default/PetstoreClient/Classes/Swaggers => swift3/default/PetstoreClient/Classes/OpenAPIs}/Models/AnimalFarm.swift (100%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/ApiResponse.swift (88%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfArrayOfNumberOnly.swift (86%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfNumberOnly.swift (85%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayTest.swift (90%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Capitalization.swift (92%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Cat.swift (84%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Category.swift (86%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ClassModel.swift (85%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Client.swift (83%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Dog.swift (84%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumArrays.swift (90%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/EnumClass.swift (71%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/EnumTest.swift (93%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/FormatTest.swift (93%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/HasOnlyReadOnly.swift (86%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/List.swift (66%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MapTest.swift (89%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MixedPropertiesAndAdditionalPropertiesClass.swift (89%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Model200Response.swift (87%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Name.swift (79%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/NumberOnly.swift (84%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Order.swift (92%) create mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/OuterEnum.swift (73%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/Pet.swift (92%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ReadOnlyFirst.swift (85%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Return.swift (85%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/SpecialModelName.swift (85%) rename samples/client/petstore/swift3/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Tag.swift (85%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => default/PetstoreClient/Classes/OpenAPIs}/Models/User.swift (92%) delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeclassnametagsAPI.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/APIHelper.swift (96%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/APIs/AnotherFakeAPI.swift (63%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/APIs/FakeAPI.swift (75%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeClassnameTags123API.swift (66%) rename samples/client/petstore/swift3/{unwraprequired/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/APIs/PetAPI.swift (84%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (85%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (83%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (98%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Configuration.swift (80%) rename samples/client/petstore/swift3/{unwraprequired/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models.swift (95%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AdditionalPropertiesClass.swift (88%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Animal.swift (86%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/AnimalFarm.swift (52%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ApiResponse.swift (89%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfArrayOfNumberOnly.swift (86%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfNumberOnly.swift (85%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayTest.swift (90%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Capitalization.swift (92%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Cat.swift (87%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Category.swift (88%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ClassModel.swift (85%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/Client.swift (83%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/Dog.swift (84%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumArrays.swift (90%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumClass.swift (71%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/EnumTest.swift (93%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/FormatTest.swift (90%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/HasOnlyReadOnly.swift (86%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/List.swift (66%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/MapTest.swift (89%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MixedPropertiesAndAdditionalPropertiesClass.swift (89%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Model200Response.swift (89%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Name.swift (77%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/NumberOnly.swift (68%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Order.swift (95%) create mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/OuterEnum.swift (73%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Pet.swift (93%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => objcCompatible/PetstoreClient/Classes/OpenAPIs}/Models/ReadOnlyFirst.swift (85%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Return.swift (88%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/SpecialModelName.swift (88%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Tag.swift (88%) rename samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/User.swift (94%) delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/APIHelper.swift (96%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/AnotherFakeAPI.swift (64%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeAPI.swift (74%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeClassnameTags123API.swift (66%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (85%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (87%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (83%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (98%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Configuration.swift (80%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models.swift (95%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AdditionalPropertiesClass.swift (88%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Animal.swift (86%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AnimalFarm.swift (52%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/ApiResponse.swift (88%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfArrayOfNumberOnly.swift (86%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfNumberOnly.swift (85%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayTest.swift (90%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Capitalization.swift (92%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Cat.swift (84%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Category.swift (86%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ClassModel.swift (85%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Client.swift (83%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Dog.swift (84%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumArrays.swift (90%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/EnumClass.swift (71%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumTest.swift (93%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/FormatTest.swift (93%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/HasOnlyReadOnly.swift (86%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/List.swift (66%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/MapTest.swift (89%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MixedPropertiesAndAdditionalPropertiesClass.swift (89%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Model200Response.swift (87%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Name.swift (79%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/NumberOnly.swift (84%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Order.swift (92%) create mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/OuterEnum.swift (73%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Pet.swift (92%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/ReadOnlyFirst.swift (85%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Return.swift (85%) rename samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/SpecialModelName.swift (85%) rename samples/client/petstore/swift3/{rxswift/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/Tag.swift (85%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => promisekit/PetstoreClient/Classes/OpenAPIs}/Models/User.swift (92%) delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeclassnametagsAPI.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIHelper.swift (96%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/APIs.swift (96%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/AnotherFakeAPI.swift (65%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeAPI.swift (75%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeClassnameTags123API.swift (67%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (86%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (87%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (84%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/AlamofireImplementations.swift (98%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Configuration.swift (80%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models.swift (95%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AdditionalPropertiesClass.swift (88%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Animal.swift (86%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AnimalFarm.swift (52%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ApiResponse.swift (88%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/ArrayOfArrayOfNumberOnly.swift (86%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayOfNumberOnly.swift (85%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayTest.swift (90%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Capitalization.swift (92%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Cat.swift (84%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Category.swift (86%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ClassModel.swift (85%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Client.swift (83%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Dog.swift (84%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumArrays.swift (90%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumClass.swift (71%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumTest.swift (93%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/FormatTest.swift (93%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/HasOnlyReadOnly.swift (86%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/List.swift (66%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MapTest.swift (89%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MixedPropertiesAndAdditionalPropertiesClass.swift (89%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Model200Response.swift (87%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Name.swift (79%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/NumberOnly.swift (84%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Order.swift (92%) create mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/OuterEnum.swift (73%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Pet.swift (92%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/ReadOnlyFirst.swift (85%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Return.swift (85%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/SpecialModelName.swift (85%) rename samples/client/petstore/swift3/{promisekit/PetstoreClient/Classes/Swaggers => rxswift/PetstoreClient/Classes/OpenAPIs}/Models/Tag.swift (85%) rename samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/User.swift (92%) delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs.swift rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift => unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift} (63%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => unwraprequired/PetstoreClient/Classes/OpenAPIs}/APIs/FakeAPI.swift (75%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeClassnameTags123API.swift (66%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => unwraprequired/PetstoreClient/Classes/OpenAPIs}/APIs/PetAPI.swift (84%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (85%) rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => unwraprequired/PetstoreClient/Classes/OpenAPIs}/APIs/UserAPI.swift (83%) create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift rename samples/client/petstore/swift3/{default/PetstoreClient/Classes/Swaggers => unwraprequired/PetstoreClient/Classes/OpenAPIs}/Extensions.swift (98%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models.swift (95%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AdditionalPropertiesClass.swift (90%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Animal.swift (88%) rename samples/client/petstore/swift3/{objcCompatible/PetstoreClient/Classes/Swaggers => unwraprequired/PetstoreClient/Classes/OpenAPIs}/Models/AnimalFarm.swift (52%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ApiResponse.swift (90%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayOfArrayOfNumberOnly.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayOfNumberOnly.swift (86%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayTest.swift (92%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Capitalization.swift (94%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Cat.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Category.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ClassModel.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Client.swift (85%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Dog.swift (86%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumArrays.swift (91%) create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumTest.swift (94%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/FormatTest.swift (89%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/HasOnlyReadOnly.swift (87%) create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MapTest.swift (91%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MixedPropertiesAndAdditionalPropertiesClass.swift (91%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Model200Response.swift (89%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Name.swift (76%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/NumberOnly.swift (86%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Order.swift (94%) create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Pet.swift (94%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ReadOnlyFirst.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Return.swift (86%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/SpecialModelName.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Tag.swift (87%) rename samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/User.swift (94%) delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIHelper.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Configuration.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/List.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterString.swift rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIHelper.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers/APIs/AnotherfakeAPI.swift => OpenAPIs/APIs/AnotherFakeAPI.swift} (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeAPI.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/FakeClassnameTags123API.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/PetAPI.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/StoreAPI.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/APIs/UserAPI.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/AlamofireImplementations.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/CodableHelper.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Configuration.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Extensions.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/JSONEncodableEncoding.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/JSONEncodingHelper.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/AdditionalPropertiesClass.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Animal.swift (100%) create mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ApiResponse.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayOfArrayOfNumberOnly.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayOfNumberOnly.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ArrayTest.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Capitalization.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Cat.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Category.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ClassModel.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Client.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Dog.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumArrays.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumClass.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/EnumTest.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/FormatTest.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/HasOnlyReadOnly.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/List.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MapTest.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/MixedPropertiesAndAdditionalPropertiesClass.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Model200Response.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Name.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/NumberOnly.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Order.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/OuterComposite.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/OuterEnum.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Pet.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/ReadOnlyFirst.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Return.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/SpecialModelName.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/Tag.swift (100%) rename samples/client/petstore/swift4/default/PetstoreClient/Classes/{Swaggers => OpenAPIs}/Models/User.swift (100%) delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift diff --git a/bin/swift-petstore-promisekit.json b/bin/swift-petstore-promisekit.json index 1211352cc5..48137f1f28 100644 --- a/bin/swift-petstore-promisekit.json +++ b/bin/swift-petstore-promisekit.json @@ -1,7 +1,7 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "responseAs": "PromiseKit" -} \ No newline at end of file +} diff --git a/bin/swift-petstore-rxswift.json b/bin/swift-petstore-rxswift.json index 3a81d53dee..eb8b11dde5 100644 --- a/bin/swift-petstore-rxswift.json +++ b/bin/swift-petstore-rxswift.json @@ -1,6 +1,6 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "responseAs": "RxSwift" diff --git a/bin/swift3-petstore-objcCompatible.json b/bin/swift3-petstore-objcCompatible.json index e56770806b..c24c7abf69 100644 --- a/bin/swift3-petstore-objcCompatible.json +++ b/bin/swift3-petstore-objcCompatible.json @@ -1,7 +1,7 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "objcCompatible": true -} \ No newline at end of file +} diff --git a/bin/swift3-petstore-promisekit.json b/bin/swift3-petstore-promisekit.json index 1211352cc5..48137f1f28 100644 --- a/bin/swift3-petstore-promisekit.json +++ b/bin/swift3-petstore-promisekit.json @@ -1,7 +1,7 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "responseAs": "PromiseKit" -} \ No newline at end of file +} diff --git a/bin/swift3-petstore-rxswift.json b/bin/swift3-petstore-rxswift.json index 3a81d53dee..eb8b11dde5 100644 --- a/bin/swift3-petstore-rxswift.json +++ b/bin/swift3-petstore-rxswift.json @@ -1,6 +1,6 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "responseAs": "RxSwift" diff --git a/bin/swift3-petstore-unwraprequired.json b/bin/swift3-petstore-unwraprequired.json index f077c429ee..3d3152c52a 100644 --- a/bin/swift3-petstore-unwraprequired.json +++ b/bin/swift3-petstore-unwraprequired.json @@ -1,7 +1,7 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "unwrapRequired": true -} \ No newline at end of file +} diff --git a/bin/swift3-petstore.json b/bin/swift3-petstore.json index 3d9ecfd5d0..59bd94f43e 100644 --- a/bin/swift3-petstore.json +++ b/bin/swift3-petstore.json @@ -1,6 +1,6 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient" -} \ No newline at end of file +} diff --git a/bin/swift4-petstore-objcCompatible.json b/bin/swift4-petstore-objcCompatible.json index e56770806b..c24c7abf69 100644 --- a/bin/swift4-petstore-objcCompatible.json +++ b/bin/swift4-petstore-objcCompatible.json @@ -1,7 +1,7 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "objcCompatible": true -} \ No newline at end of file +} diff --git a/bin/swift4-petstore-promisekit.json b/bin/swift4-petstore-promisekit.json index 1211352cc5..48137f1f28 100644 --- a/bin/swift4-petstore-promisekit.json +++ b/bin/swift4-petstore-promisekit.json @@ -1,7 +1,7 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "responseAs": "PromiseKit" -} \ No newline at end of file +} diff --git a/bin/swift4-petstore-rxswift.json b/bin/swift4-petstore-rxswift.json index 3a81d53dee..eb8b11dde5 100644 --- a/bin/swift4-petstore-rxswift.json +++ b/bin/swift4-petstore-rxswift.json @@ -1,6 +1,6 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient", "responseAs": "RxSwift" diff --git a/bin/swift4-petstore.json b/bin/swift4-petstore.json index 3d9ecfd5d0..59bd94f43e 100644 --- a/bin/swift4-petstore.json +++ b/bin/swift4-petstore.json @@ -1,6 +1,6 @@ { "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "PetstoreClient" -} \ No newline at end of file +} diff --git a/bin/swift4-test.json b/bin/swift4-test.json index 1734cf8d99..9341b740a2 100644 --- a/bin/swift4-test.json +++ b/bin/swift4-test.json @@ -1,6 +1,6 @@ { "podSummary": "TestClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podHomepage": "https://github.com/openapitools/openapi-generator", "podAuthors": "", "projectName": "TestClient" -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java index bfca557933..1fbe079abe 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java @@ -17,26 +17,14 @@ package org.openapitools.codegen.languages; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; - -import org.openapitools.codegen.*; -import org.openapitools.codegen.utils.*; -import org.openapitools.codegen.mustache.*; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.*; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.parameters.*; -import io.swagger.v3.core.util.Yaml; -import io.swagger.v3.parser.util.SchemaTypeUtil; - +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; -import javax.annotation.Nullable; import java.io.File; import java.util.*; import java.util.regex.Matcher; @@ -58,7 +46,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { public static final String POD_SCREENSHOTS = "podScreenshots"; public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; - public static final String DEFAULT_POD_AUTHORS = "Swagger Codegen"; + public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; public static final String LENIENT_TYPE_CAST = "lenientTypeCast"; protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; protected static final String LIBRARY_RX_SWIFT = "RxSwift"; @@ -69,7 +57,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { protected boolean lenientTypeCast = false; protected boolean swiftUseApiNamespace; protected String[] responseAs = new String[0]; - protected String sourceFolder = "Classes" + File.separator + "Swaggers"; + protected String sourceFolder = "Classes" + File.separator + "OpenAPIs"; public Swift3Codegen() { super(); @@ -176,6 +164,50 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { .defaultValue(Boolean.FALSE.toString())); } + 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. + + // Get the properties for the parent and child models + final List parentModelCodegenProperties = parentCodegenModel.vars; + List codegenProperties = codegenModel.vars; + codegenModel.allVars = new ArrayList(codegenProperties); + codegenModel.parentVars = parentCodegenModel.allVars; + + // Iterate over all of the parent model properties + 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.equals(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) { + count += 1; + codegenProperty.hasMore = count < numVars; + } + codegenModel.vars = codegenProperties; + } + + + return codegenModel; + } + @Override public CodegenType getTag() { return CodegenType.CLIENT; @@ -386,8 +418,7 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { @Override public String toInstantiationType(Schema p) { if (ModelUtils.isMapSchema(p)) { - String inner = getSchemaType((Schema) p.getAdditionalProperties()); - return inner; + return getSchemaType((Schema) p.getAdditionalProperties()); } else if (ModelUtils.isArraySchema(p)) { ArraySchema ap = (ArraySchema) p; String inner = getSchemaType(ap.getItems()); @@ -639,48 +670,4 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } - - 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. - - // Get the properties for the parent and child models - final List parentModelCodegenProperties = parentCodegenModel.vars; - List codegenProperties = codegenModel.vars; - codegenModel.allVars = new ArrayList(codegenProperties); - codegenModel.parentVars = parentCodegenModel.allVars; - - // Iterate over all of the parent model properties - 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) { - // 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) { - count += 1; - codegenProperty.hasMore = (count < numVars) ? true : false; - } - codegenModel.vars = codegenProperties; - } - - - return codegenModel; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index 4305ea8d4a..ec5605ef60 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -17,37 +17,18 @@ package org.openapitools.codegen.languages; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; - -import io.swagger.models.Model; -import org.openapitools.codegen.*; -import org.openapitools.codegen.utils.*; -import org.openapitools.codegen.mustache.*; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.*; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.parameters.*; -import io.swagger.v3.core.util.Yaml; -import io.swagger.v3.parser.util.SchemaTypeUtil; - +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; import java.io.File; -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.*; 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"; @@ -65,7 +46,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { public static final String POD_SCREENSHOTS = "podScreenshots"; public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; - public static final String DEFAULT_POD_AUTHORS = "Swagger Codegen"; + public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; public static final String LENIENT_TYPE_CAST = "lenientTypeCast"; protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; protected static final String LIBRARY_RX_SWIFT = "RxSwift"; @@ -76,33 +57,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { protected boolean lenientTypeCast = false; protected boolean swiftUseApiNamespace; protected String[] responseAs = new String[0]; - protected String sourceFolder = "Classes" + File.separator + "Swaggers"; - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "swift4"; - } - - @Override - public String getHelp() { - return "Generates a Swift 4.x client library."; - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, - Schema schema) { - - final Schema additionalProperties = (Schema) schema.getAdditionalProperties(); - - if (additionalProperties != null) { - codegenModel.additionalPropertiesType = getSchemaType(additionalProperties); - } - } + protected String sourceFolder = "Classes" + File.separator + "OpenAPIs"; /** * Constructor for the swift4 language codegen module. @@ -259,6 +214,79 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { .defaultValue(Boolean.FALSE.toString())); } + 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. + + // Get the properties for the parent and child models + final List parentModelCodegenProperties = parentCodegenModel.vars; + List codegenProperties = codegenModel.vars; + codegenModel.allVars = new ArrayList(codegenProperties); + codegenModel.parentVars = parentCodegenModel.allVars; + + // Iterate over all of the parent model properties + 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.equals(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; + int numVars = codegenProperties.size(); + for (CodegenProperty codegenProperty : codegenProperties) { + count += 1; + codegenProperty.hasMore = count < numVars; + } + codegenModel.vars = codegenProperties; + } + + + return codegenModel; + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "swift4"; + } + + @Override + public String getHelp() { + return "Generates a Swift 4.x client library."; + } + + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, + Schema schema) { + + final Schema additionalProperties = (Schema) schema.getAdditionalProperties(); + + if (additionalProperties != null) { + codegenModel.additionalPropertiesType = getSchemaType(additionalProperties); + } + } + @Override public void processOpts() { super.processOpts(); @@ -492,8 +520,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { @Override public String toInstantiationType(Schema p) { if (ModelUtils.isMapSchema(p)) { - String inner = getSchemaType((Schema) p.getAdditionalProperties()); - return inner; + return getSchemaType((Schema) p.getAdditionalProperties()); } else if (ModelUtils.isArraySchema(p)) { ArraySchema ap = (ArraySchema) p; String inner = getSchemaType(ap.getItems()); @@ -792,51 +819,4 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } - - 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. - - // Get the properties for the parent and child models - final List parentModelCodegenProperties = parentCodegenModel.vars; - List codegenProperties = codegenModel.vars; - codegenModel.allVars = new ArrayList(codegenProperties); - codegenModel.parentVars = parentCodegenModel.allVars; - - // Iterate over all of the parent model properties - 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.equals(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; - int numVars = codegenProperties.size(); - for (CodegenProperty codegenProperty : codegenProperties) { - count += 1; - codegenProperty.hasMore = (count < numVars) ? true : false; - } - codegenModel.vars = codegenProperties; - } - - - return codegenModel; - } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java index 3df820e9ee..30c16c62f9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java @@ -17,33 +17,23 @@ package org.openapitools.codegen.languages; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; - -import org.openapitools.codegen.*; -import org.openapitools.codegen.utils.*; -import org.openapitools.codegen.mustache.*; -import io.swagger.v3.oas.models.security.SecurityScheme; -import io.swagger.v3.oas.models.*; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.parameters.*; -import io.swagger.v3.core.util.Yaml; -import io.swagger.v3.parser.util.SchemaTypeUtil; - +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; -import javax.annotation.Nullable; -import java.util.*; import java.io.File; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * Swift (2.x) generator is no longer actively maintained. Please use + * Swift (2.x) generator is no longer actively maintained. Please use * 'swift3' or 'swift4' generator instead. */ @@ -62,15 +52,15 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig public static final String POD_SCREENSHOTS = "podScreenshots"; public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; - public static final String DEFAULT_POD_AUTHORS = "Swagger Codegen"; + public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; protected static final String LIBRARY_RX_SWIFT = "RxSwift"; - protected static final String[] RESPONSE_LIBRARIES = { LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT }; + protected static final String[] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT}; protected String projectName = "OpenAPIClient"; protected boolean unwrapRequired; protected boolean swiftUseApiNamespace; protected String[] responseAs = new String[0]; - protected String sourceFolder = "Classes" + File.separator + "Swaggers"; + protected String sourceFolder = "Classes" + File.separator + "OpenAPIs"; private static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z_]+\\}"); @Override @@ -102,45 +92,45 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig languageSpecificPrimitives = new HashSet( Arrays.asList( - "Int", - "Int32", - "Int64", - "Float", - "Double", - "Bool", - "Void", - "String", - "Character", - "AnyObject") - ); + "Int", + "Int32", + "Int64", + "Float", + "Double", + "Bool", + "Void", + "String", + "Character", + "AnyObject") + ); defaultIncludes = new HashSet( Arrays.asList( - "NSData", - "NSDate", - "NSURL", // for file - "NSUUID", - "Array", - "Dictionary", - "Set", - "Any", - "Empty", - "AnyObject") - ); + "NSData", + "NSDate", + "NSURL", // for file + "NSUUID", + "Array", + "Dictionary", + "Set", + "Any", + "Empty", + "AnyObject") + ); reservedWords = new HashSet( Arrays.asList( - // name used by swift client - "ErrorResponse", + // name used by swift client + "ErrorResponse", - // swift keywords - "Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject", - "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") - ); + // swift keywords + "Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject", + "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") + ); typeMapping = new HashMap(); typeMapping.put("array", "Array"); @@ -162,7 +152,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig typeMapping.put("double", "Double"); typeMapping.put("object", "AnyObject"); typeMapping.put("file", "NSURL"); - typeMapping.put("binary", "NSData"); + typeMapping.put("binary", "NSURL"); typeMapping.put("ByteArray", "NSData"); typeMapping.put("UUID", "NSUUID"); @@ -170,9 +160,9 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig 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.")); + 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")); + "(which would crash the app if api returns null as opposed to required option specified in json schema")); 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")); @@ -211,7 +201,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig if (additionalProperties.containsKey(RESPONSE_AS)) { Object responseAsObject = additionalProperties.get(RESPONSE_AS); if (responseAsObject instanceof String) { - setResponseAs(((String)responseAsObject).split(",")); + setResponseAs(((String) responseAsObject).split(",")); } else { setResponseAs((String[]) responseAsObject); } @@ -237,7 +227,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig 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")); + "AlamofireImplementations.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")); @@ -250,14 +240,14 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig protected boolean isReservedWord(String word) { return word != null && reservedWords.contains(word); //don't lowercase as super does } - + @Override - public String escapeReservedWord(String name) { - if(this.reservedWordsMappings().containsKey(name)) { + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { return this.reservedWordsMappings().get(name); } return "_" + name; // add an underscore to the name - } + } @Override public String modelFileFolder() { @@ -388,7 +378,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig if (codegenProperty.isEnum) { List> swiftEnums = new ArrayList>(); List values = (List) codegenProperty.allowableValues.get("values"); - + for (Object value : values) { Map map = new HashMap(); map.put("enum", toSwiftyEnumName(String.valueOf(value))); @@ -399,7 +389,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig codegenProperty.datatypeWithEnum = toEnumName(codegenProperty); //codegenProperty.datatypeWithEnum = // StringUtils.left(codegenProperty.datatypeWithEnum, codegenProperty.datatypeWithEnum.length() - "Enum".length()); - + // 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 @@ -422,7 +412,7 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig value = value.replaceAll("\\+", "Plus"); value = value.replaceAll("\\.", "Dot"); } - + // Prevent from breaking properly cased identifier if (value.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { return value; @@ -435,14 +425,14 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig @Override public String toApiName(String name) { - if(name.length() == 0) + if (name.length() == 0) return "DefaultAPI"; return initialCaps(name) + "API"; } @Override public String toOperationId(String operationId) { - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), true); // throw exception if method name is empty. This should not happen but keep the check just in case if (StringUtils.isEmpty(operationId)) { @@ -526,9 +516,9 @@ public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig String group = matcher.group().substring(1, matcher.group().length() - 1); group = camelize(group, true); builder - .append("{") - .append(group) - .append("}"); + .append("{") + .append(group) + .append("}"); cursor = matcher.end(); found = matcher.find(); diff --git a/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache index e1a9756fba..6752df2dfc 100644 --- a/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache @@ -188,8 +188,6 @@ class AlamofireRequestBuilder: RequestBuilder { completion(response: Response(response: response.response!, body: body), error: nil) return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(response: Response(response: response.response!, body: "" as! T), error: nil) return } diff --git a/modules/openapi-generator/src/main/resources/swift/Models.mustache b/modules/openapi-generator/src/main/resources/swift/Models.mustache index 700cb2a4a5..ea3ee57c49 100644 --- a/modules/openapi-generator/src/main/resources/swift/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift/Models.mustache @@ -80,7 +80,7 @@ class Decoders { if let decoder = decoders[key] { return decoder(source) as! T } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe swagger file is insufficient") + fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") } } diff --git a/modules/openapi-generator/src/main/resources/swift/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift/Podspec.mustache index 8037dec387..3f0ae6c07c 100644 --- a/modules/openapi-generator/src/main/resources/swift/Podspec.mustache +++ b/modules/openapi-generator/src/main/resources/swift/Podspec.mustache @@ -4,7 +4,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' - s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' }{{/podSource}} + s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}} {{#podAuthors}} s.authors = '{{podAuthors}}' {{/podAuthors}} diff --git a/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache index 8aadb016f1..5be6b2b08c 100644 --- a/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache @@ -296,8 +296,6 @@ open class AlamofireRequestBuilder: RequestBuilder { } return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(Response(response: response.response!, body: ("" as! T)), nil) return } diff --git a/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache index de8b124198..e92e9f47ae 100644 --- a/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache +++ b/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' - s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}} + s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}} s.authors = '{{podAuthors}}'{{/podAuthors}}{{#podSocialMediaURL}} s.social_media_url = '{{podSocialMediaURL}}'{{/podSocialMediaURL}}{{#podDocsetURL}} s.docset_url = '{{podDocsetURL}}'{{/podDocsetURL}} diff --git a/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache index 8c9689ea9e..cbb1538422 100644 --- a/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache +++ b/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' - s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}} + s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}} s.authors = '{{podAuthors}}'{{/podAuthors}}{{#podSocialMediaURL}} s.social_media_url = '{{podSocialMediaURL}}'{{/podSocialMediaURL}}{{#podDocsetURL}} s.docset_url = '{{podDocsetURL}}'{{/podDocsetURL}} diff --git a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml index 909e06fa52..c7205a8e0e 100644 --- a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml @@ -606,7 +606,7 @@ paths: description: To test enum parameters operationId: testEnumParameters consumes: - - "*/*" + - application/x-www-form-urlencoded produces: - "*/*" parameters: @@ -703,8 +703,7 @@ paths: 가짜 엔드 포인트 operationId: testEndpointParameters consumes: - - application/xml; charset=utf-8 - - application/json; charset=utf-8 + - application/x-www-form-urlencoded produces: - application/xml; charset=utf-8 - application/json; charset=utf-8 @@ -874,7 +873,7 @@ paths: description: '' operationId: testJsonFormData consumes: - - application/json + - application/x-www-form-urlencoded parameters: - name: param in: formData diff --git a/samples/client/petstore/swift/default/.openapi-generator/VERSION b/samples/client/petstore/swift/default/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/default/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/default/PetstoreClient.podspec b/samples/client/petstore/swift/default/PetstoreClient.podspec index 3dfd51fba0..acf5565947 100644 --- a/samples/client/petstore/swift/default/PetstoreClient.podspec +++ b/samples/client/petstore/swift/default/PetstoreClient.podspec @@ -4,7 +4,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' s.homepage = 'https://github.com/swagger-api/swagger-codegen' diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 94% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index b91cd27851..2e354e5418 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // class APIHelper { diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 55d7017c45..1c2511ded5 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 86% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 9e6c8762f8..bb190adbd4 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -13,11 +13,11 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error: error); } } @@ -25,20 +25,17 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - POST /pet - - - - OAuth: + - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = pet?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -63,12 +60,9 @@ public class PetAPI: APIBase { /** Deletes a pet - - DELETE /pet/{petId} - - - - OAuth: + - DELETE /pet/{petId} - OAuth: - type: oauth2 - name: petstore_auth - - parameter petId: (path) Pet id to delete - parameter apiKey: (header) (optional) @@ -97,7 +91,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional) - parameter completion: completion handler to receive the data and the error objects */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { @@ -110,19 +104,62 @@ public class PetAPI: APIBase { /** Finds Pets by status - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: + - Multiple status values can be provided with comma separated strings - OAuth: - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "name" : "Puma", - "type" : "Dog", - "color" : "Black", - "gender" : "Female", - "breed" : "Mixed" -}}] - - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - examples: [{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" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> */ @@ -159,11 +196,10 @@ public class PetAPI: APIBase { /** Finds Pets by tags - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example=[ { + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -179,23 +215,7 @@ public class PetAPI: APIBase { "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" -} ]}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -205,7 +225,7 @@ public class PetAPI: APIBase { aeiou }] - - examples: [{contentType=application/json, example=[ { + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -221,23 +241,7 @@ public class PetAPI: APIBase { "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" -} ]}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -247,7 +251,6 @@ public class PetAPI: APIBase { aeiou }] - - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -285,8 +288,7 @@ public class PetAPI: APIBase { /** Find pet by ID - GET /pet/{petId} - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - API Key: + - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - API Key: - type: apiKey api_key - name: api_key - OAuth: @@ -344,7 +346,6 @@ public class PetAPI: APIBase { aeiou }] - - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -368,11 +369,11 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error: error); } } @@ -380,20 +381,17 @@ public class PetAPI: APIBase { /** Update an existing pet - - PUT /pet - - - - OAuth: + - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = pet?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -419,12 +417,9 @@ public class PetAPI: APIBase { /** Updates a pet in the store with form data - - POST /pet/{petId} - - - - OAuth: + - 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) @@ -467,12 +462,9 @@ public class PetAPI: APIBase { /** uploads an image - - POST /pet/{petId}/uploadImage - - - - OAuth: + - POST /pet/{petId}/uploadImage - OAuth: - type: oauth2 - name: petstore_auth - - 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) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 84% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3a67542540..8a3133a8f8 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -26,9 +26,7 @@ public class StoreAPI: APIBase { /** Delete purchase order by ID - DELETE /store/order/{orderId} - - 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 + - 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 */ @@ -63,16 +61,9 @@ public class StoreAPI: APIBase { /** Returns pet inventories by status - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: + - Returns a map of status codes to quantities - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}, {contentType=application/xml, example=}] - - examples: [{contentType=application/json, example={ - "key" : 0 -}}, {contentType=application/xml, example=}] - returns: RequestBuilder<[String:Int32]> */ @@ -107,8 +98,7 @@ public class StoreAPI: APIBase { /** Find purchase order by ID - GET /store/order/{orderId} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, @@ -138,7 +128,6 @@ public class StoreAPI: APIBase { aeiou true }] - - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -162,11 +151,11 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(data: response?.body, error: error); } } @@ -174,9 +163,7 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - POST /store/order - - - - examples: [{contentType=application/json, example={ + - POST /store/order - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, @@ -206,15 +193,14 @@ public class StoreAPI: APIBase { aeiou true }] - - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = order?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 80% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index b718f6d0db..fa0db1bc52 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -13,11 +13,11 @@ public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -26,16 +26,14 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - - - parameter body: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -47,11 +45,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -59,17 +57,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - - - - - parameter body: (body) List of user object (optional) + - POST /user/createWithArray - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -81,11 +76,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -93,17 +88,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - - - - - parameter body: (body) List of user object (optional) + - POST /user/createWithList - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -128,9 +120,7 @@ public class UserAPI: APIBase { /** 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 + - This can only be done by the logged in user. - parameter username: (path) The name that needs to be deleted - returns: RequestBuilder */ @@ -165,9 +155,7 @@ public class UserAPI: APIBase { /** Get user by user name - - GET /user/{username} - - - - examples: [{contentType=application/json, example={ + - GET /user/{username} - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -205,7 +193,6 @@ public class UserAPI: APIBase { aeiou 123 }] - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -242,12 +229,7 @@ public class UserAPI: APIBase { /** Logs user into the system - - GET /user/login - - - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=aeiou}] - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=aeiou}] - - - parameter username: (query) The user name for login (optional) + - GET /user/login - parameter username: (query) The user name for login (optional) - parameter password: (query) The password for login in clear text (optional) - returns: RequestBuilder @@ -285,8 +267,6 @@ public class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ public class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -308,11 +288,11 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -321,18 +301,16 @@ public class UserAPI: APIBase { /** 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 (optional) + - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 95% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 0536080ca7..6752df2dfc 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -66,16 +66,12 @@ class AlamofireRequestBuilder: RequestBuilder { switch v { case let fileURL as NSURL: mpForm.appendBodyPart(fileURL: fileURL, name: k) - break case let string as NSString: mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - break case let number as NSNumber: mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - break default: fatalError("Unprocessable value \(v) with key \(k)") - break } } }, @@ -192,8 +188,6 @@ class AlamofireRequestBuilder: RequestBuilder { completion(response: Response(response: response.response!, body: body), error: nil) return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(response: Response(response: response.response!, body: "" as! T), error: nil) return } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index d14c7fc808..c04e734a7c 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 98% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 2e6f7ecc62..37d49d13e2 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -80,7 +80,7 @@ class Decoders { if let decoder = decoders[key] { return decoder(source) as! T } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe swagger file is insufficient") + fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 86% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89ce2ccb61..ea5e47f3cf 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 92% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 87b2a2c524..90dfd94122 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 92% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ebcd2c1825..f24e12684e 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 86% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 774f91557e..d79d8df25e 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 92% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 67b72a6192..c4032cd386 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/default/git_push.sh b/samples/client/petstore/swift/default/git_push.sh index ae01b182ae..8442b80bb4 100644 --- a/samples/client/petstore/swift/default/git_push.sh +++ b/samples/client/petstore/swift/default/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift/promisekit/PetstoreClient.podspec index edae4a6de3..1d2b7339d3 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient.podspec +++ b/samples/client/petstore/swift/promisekit/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'PromiseKit', '~> 3.5.3' diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 94% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index b91cd27851..2e354e5418 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // class APIHelper { diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift index 55d7017c45..1c2511ded5 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 87% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0d16b8b3dc..d7402b3861 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -14,11 +14,11 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func addPet(body body: Pet? = nil) -> Promise { + public class func addPet(pet pet: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -43,20 +43,17 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - POST /pet - - - - OAuth: + - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = pet?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -99,12 +96,9 @@ public class PetAPI: APIBase { /** Deletes a pet - - DELETE /pet/{petId} - - - - OAuth: + - DELETE /pet/{petId} - OAuth: - type: oauth2 - name: petstore_auth - - parameter petId: (path) Pet id to delete - parameter apiKey: (header) (optional) @@ -133,7 +127,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional) - parameter completion: completion handler to receive the data and the error objects */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { @@ -145,7 +139,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional) - returns: Promise<[Pet]> */ public class func findPetsByStatus(status status: [String]? = nil) -> Promise<[Pet]> { @@ -163,19 +157,62 @@ public class PetAPI: APIBase { /** Finds Pets by status - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: + - Multiple status values can be provided with comma separated strings - OAuth: - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "name" : "Puma", - "type" : "Dog", - "color" : "Black", - "gender" : "Female", - "breed" : "Mixed" -}}] - - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - examples: [{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" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> */ @@ -229,11 +266,10 @@ public class PetAPI: APIBase { /** Finds Pets by tags - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example=[ { + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -249,23 +285,7 @@ public class PetAPI: APIBase { "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" -} ]}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -275,7 +295,7 @@ public class PetAPI: APIBase { aeiou }] - - examples: [{contentType=application/json, example=[ { + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -291,23 +311,7 @@ public class PetAPI: APIBase { "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" -} ]}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -317,7 +321,6 @@ public class PetAPI: APIBase { aeiou }] - - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -372,8 +375,7 @@ public class PetAPI: APIBase { /** Find pet by ID - GET /pet/{petId} - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - API Key: + - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - API Key: - type: apiKey api_key - name: api_key - OAuth: @@ -431,7 +433,6 @@ public class PetAPI: APIBase { aeiou }] - - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -455,11 +456,11 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error: error); } } @@ -467,12 +468,12 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func updatePet(body body: Pet? = nil) -> Promise { + public class func updatePet(pet pet: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -484,20 +485,17 @@ public class PetAPI: APIBase { /** Update an existing pet - - PUT /pet - - - - OAuth: + - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = pet?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -542,12 +540,9 @@ public class PetAPI: APIBase { /** Updates a pet in the store with form data - - POST /pet/{petId} - - - - OAuth: + - 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) @@ -609,12 +604,9 @@ public class PetAPI: APIBase { /** uploads an image - - POST /pet/{petId}/uploadImage - - - - OAuth: + - POST /pet/{petId}/uploadImage - OAuth: - type: oauth2 - name: petstore_auth - - 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) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 85% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 5cb8d755a1..3f3834a042 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -44,9 +44,7 @@ public class StoreAPI: APIBase { /** Delete purchase order by ID - DELETE /store/order/{orderId} - - 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 + - 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 */ @@ -97,16 +95,9 @@ public class StoreAPI: APIBase { /** Returns pet inventories by status - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: + - Returns a map of status codes to quantities - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}, {contentType=application/xml, example=}] - - examples: [{contentType=application/json, example={ - "key" : 0 -}}, {contentType=application/xml, example=}] - returns: RequestBuilder<[String:Int32]> */ @@ -158,8 +149,7 @@ public class StoreAPI: APIBase { /** Find purchase order by ID - GET /store/order/{orderId} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, @@ -189,7 +179,6 @@ public class StoreAPI: APIBase { aeiou true }] - - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -213,11 +202,11 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(data: response?.body, error: error); } } @@ -225,12 +214,12 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: Promise */ - public class func placeOrder(body body: Order? = nil) -> Promise { + public class func placeOrder(order order: Order? = nil) -> Promise { let deferred = Promise.pendingPromise() - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { deferred.reject(error) } else { @@ -242,9 +231,7 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - POST /store/order - - - - examples: [{contentType=application/json, example={ + - POST /store/order - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, @@ -274,15 +261,14 @@ public class StoreAPI: APIBase { aeiou true }] - - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = order?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 81% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f4bd16ab67..d5ebe76cfe 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -14,11 +14,11 @@ public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - returns: Promise */ - public class func createUser(body body: User? = nil) -> Promise { + public class func createUser(user user: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -44,16 +44,14 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - - - parameter body: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -65,11 +63,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -77,12 +75,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithArrayInput(body body: [User]? = nil) -> Promise { + public class func createUsersWithArrayInput(user user: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -94,17 +92,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - - - - - parameter body: (body) List of user object (optional) + - POST /user/createWithArray - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -116,11 +111,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -128,12 +123,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithListInput(body body: [User]? = nil) -> Promise { + public class func createUsersWithListInput(user user: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -145,17 +140,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - - - - - parameter body: (body) List of user object (optional) + - POST /user/createWithList - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -197,9 +189,7 @@ public class UserAPI: APIBase { /** 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 + - This can only be done by the logged in user. - parameter username: (path) The name that needs to be deleted - returns: RequestBuilder */ @@ -251,9 +241,7 @@ public class UserAPI: APIBase { /** Get user by user name - - GET /user/{username} - - - - examples: [{contentType=application/json, example={ + - GET /user/{username} - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -291,7 +279,6 @@ public class UserAPI: APIBase { aeiou 123 }] - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -346,12 +333,7 @@ public class UserAPI: APIBase { /** Logs user into the system - - GET /user/login - - - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=aeiou}] - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=aeiou}] - - - parameter username: (query) The user name for login (optional) + - GET /user/login - parameter username: (query) The user name for login (optional) - parameter password: (query) The password for login in clear text (optional) - returns: RequestBuilder @@ -405,8 +387,6 @@ public class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ public class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -428,11 +408,11 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -441,12 +421,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: Promise */ - public class func updateUser(username username: String, body: User? = nil) -> Promise { + public class func updateUser(username username: String, user: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { deferred.reject(error) } else { @@ -459,18 +439,16 @@ public class UserAPI: APIBase { /** 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 (optional) + - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 95% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 0536080ca7..6752df2dfc 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -66,16 +66,12 @@ class AlamofireRequestBuilder: RequestBuilder { switch v { case let fileURL as NSURL: mpForm.appendBodyPart(fileURL: fileURL, name: k) - break case let string as NSString: mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - break case let number as NSNumber: mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - break default: fatalError("Unprocessable value \(v) with key \(k)") - break } } }, @@ -192,8 +188,6 @@ class AlamofireRequestBuilder: RequestBuilder { completion(response: Response(response: response.response!, body: body), error: nil) return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(response: Response(response: response.response!, body: "" as! T), error: nil) return } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5eb25e5ecb..5911dd589c 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 98% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index 2e6f7ecc62..37d49d13e2 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -80,7 +80,7 @@ class Decoders { if let decoder = decoders[key] { return decoder(source) as! T } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe swagger file is insufficient") + fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 86% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89ce2ccb61..ea5e47f3cf 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 92% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 87b2a2c524..90dfd94122 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 92% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ebcd2c1825..f24e12684e 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 86% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 774f91557e..d79d8df25e 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 92% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 67b72a6192..c4032cd386 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/promisekit/git_push.sh b/samples/client/petstore/swift/promisekit/git_push.sh index ae01b182ae..8442b80bb4 100644 --- a/samples/client/petstore/swift/promisekit/git_push.sh +++ b/samples/client/petstore/swift/promisekit/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift/rxswift/PetstoreClient.podspec index be152f2726..a0cc86beb3 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient.podspec +++ b/samples/client/petstore/swift/rxswift/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'RxSwift', '~> 2.6.1' diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 94% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index b91cd27851..2e354e5418 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // class APIHelper { diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift index 55d7017c45..1c2511ded5 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 88% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 23a19b3859..aa63567858 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -14,11 +14,11 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func addPet(body body: Pet? = nil) -> Observable { + public class func addPet(pet pet: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -45,20 +45,17 @@ public class PetAPI: APIBase { /** Add a new pet to the store - - POST /pet - - - - OAuth: + - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = pet?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -103,12 +100,9 @@ public class PetAPI: APIBase { /** Deletes a pet - - DELETE /pet/{petId} - - - - OAuth: + - DELETE /pet/{petId} - OAuth: - type: oauth2 - name: petstore_auth - - parameter petId: (path) Pet id to delete - parameter apiKey: (header) (optional) @@ -137,7 +131,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional) - parameter completion: completion handler to receive the data and the error objects */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { @@ -149,7 +143,7 @@ public class PetAPI: APIBase { /** Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + - parameter status: (query) Status values that need to be considered for filter (optional) - returns: Observable<[Pet]> */ public class func findPetsByStatus(status status: [String]? = nil) -> Observable<[Pet]> { @@ -169,19 +163,62 @@ public class PetAPI: APIBase { /** Finds Pets by status - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: + - Multiple status values can be provided with comma separated strings - OAuth: - type: oauth2 - name: petstore_auth - examples: [{contentType=application/json, example={ - "name" : "Puma", - "type" : "Dog", - "color" : "Black", - "gender" : "Female", - "breed" : "Mixed" -}}] - - - parameter status: (query) Status values that need to be considered for filter (optional, default to available) + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - examples: [{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" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> */ @@ -237,11 +274,10 @@ public class PetAPI: APIBase { /** Finds Pets by tags - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example=[ { + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -257,23 +293,7 @@ public class PetAPI: APIBase { "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" -} ]}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -283,7 +303,7 @@ public class PetAPI: APIBase { aeiou }] - - examples: [{contentType=application/json, example=[ { + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -299,23 +319,7 @@ public class PetAPI: APIBase { "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" -} ]}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -325,7 +329,6 @@ public class PetAPI: APIBase { aeiou }] - - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -382,8 +385,7 @@ public class PetAPI: APIBase { /** Find pet by ID - GET /pet/{petId} - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - API Key: + - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - API Key: - type: apiKey api_key - name: api_key - OAuth: @@ -441,7 +443,6 @@ public class PetAPI: APIBase { aeiou }] - - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -465,11 +466,11 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error: error); } } @@ -477,12 +478,12 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func updatePet(body body: Pet? = nil) -> Observable { + public class func updatePet(pet pet: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -496,20 +497,17 @@ public class PetAPI: APIBase { /** Update an existing pet - - PUT /pet - - - - OAuth: + - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = pet?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -556,12 +554,9 @@ public class PetAPI: APIBase { /** Updates a pet in the store with form data - - POST /pet/{petId} - - - - OAuth: + - 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) @@ -625,12 +620,9 @@ public class PetAPI: APIBase { /** uploads an image - - POST /pet/{petId}/uploadImage - - - - OAuth: + - POST /pet/{petId}/uploadImage - OAuth: - type: oauth2 - name: petstore_auth - - 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) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 85% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index ec2b44008e..8e0a210ed7 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -46,9 +46,7 @@ public class StoreAPI: APIBase { /** Delete purchase order by ID - DELETE /store/order/{orderId} - - 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 + - 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 */ @@ -101,16 +99,9 @@ public class StoreAPI: APIBase { /** Returns pet inventories by status - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: + - Returns a map of status codes to quantities - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}, {contentType=application/xml, example=}] - - examples: [{contentType=application/json, example={ - "key" : 0 -}}, {contentType=application/xml, example=}] - returns: RequestBuilder<[String:Int32]> */ @@ -164,8 +155,7 @@ public class StoreAPI: APIBase { /** Find purchase order by ID - GET /store/order/{orderId} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, @@ -195,7 +185,6 @@ public class StoreAPI: APIBase { aeiou true }] - - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -219,11 +208,11 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(data: response?.body, error: error); } } @@ -231,12 +220,12 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: Observable */ - public class func placeOrder(body body: Order? = nil) -> Observable { + public class func placeOrder(order order: Order? = nil) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -250,9 +239,7 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - POST /store/order - - - - examples: [{contentType=application/json, example={ + - POST /store/order - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, @@ -282,15 +269,14 @@ public class StoreAPI: APIBase { aeiou true }] - - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = order?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 82% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index e23203b120..a3a0e0b2d3 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -14,11 +14,11 @@ public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -26,12 +26,12 @@ public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - returns: Observable */ - public class func createUser(body body: User? = nil) -> Observable { + public class func createUser(user user: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -46,16 +46,14 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - - - parameter body: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -67,11 +65,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -79,12 +77,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithArrayInput(body body: [User]? = nil) -> Observable { + public class func createUsersWithArrayInput(user user: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -98,17 +96,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - - - - - parameter body: (body) List of user object (optional) + - POST /user/createWithArray - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -120,11 +115,11 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -132,12 +127,12 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithListInput(body body: [User]? = nil) -> Observable { + public class func createUsersWithListInput(user user: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -151,17 +146,14 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - - - - - parameter body: (body) List of user object (optional) + - POST /user/createWithList - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) @@ -205,9 +197,7 @@ public class UserAPI: APIBase { /** 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 + - This can only be done by the logged in user. - parameter username: (path) The name that needs to be deleted - returns: RequestBuilder */ @@ -261,9 +251,7 @@ public class UserAPI: APIBase { /** Get user by user name - - GET /user/{username} - - - - examples: [{contentType=application/json, example={ + - GET /user/{username} - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -301,7 +289,6 @@ public class UserAPI: APIBase { aeiou 123 }] - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -358,12 +345,7 @@ public class UserAPI: APIBase { /** Logs user into the system - - GET /user/login - - - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=aeiou}] - - examples: [{contentType=application/json, example=""}, {contentType=application/xml, example=aeiou}] - - - parameter username: (query) The user name for login (optional) + - GET /user/login - parameter username: (query) The user name for login (optional) - parameter password: (query) The password for login in clear text (optional) - returns: RequestBuilder @@ -419,8 +401,6 @@ public class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ public class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -442,11 +422,11 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error: error); } } @@ -455,12 +435,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: Observable */ - public class func updateUser(username username: String, body: User? = nil) -> Observable { + public class func updateUser(username username: String, user: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -475,18 +455,16 @@ public class UserAPI: APIBase { /** 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 (optional) + - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = user?.encodeToJSON() as? [String:AnyObject] let convertedParameters = APIHelper.convertBoolToString(parameters) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 95% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 0536080ca7..6752df2dfc 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire @@ -66,16 +66,12 @@ class AlamofireRequestBuilder: RequestBuilder { switch v { case let fileURL as NSURL: mpForm.appendBodyPart(fileURL: fileURL, name: k) - break case let string as NSString: mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - break case let number as NSNumber: mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - break default: fatalError("Unprocessable value \(v) with key \(k)") - break } } }, @@ -192,8 +188,6 @@ class AlamofireRequestBuilder: RequestBuilder { completion(response: Response(response: response.response!, body: body), error: nil) return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(response: Response(response: response.response!, body: "" as! T), error: nil) return } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift index d14c7fc808..c04e734a7c 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Alamofire diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 98% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index 2e6f7ecc62..37d49d13e2 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -80,7 +80,7 @@ class Decoders { if let decoder = decoders[key] { return decoder(source) as! T } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe swagger file is insufficient") + fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 86% rename from samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89ce2ccb61..ea5e47f3cf 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 92% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 87b2a2c524..90dfd94122 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 92% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ebcd2c1825..f24e12684e 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 86% rename from samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 774f91557e..d79d8df25e 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 92% rename from samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 67b72a6192..c4032cd386 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift/rxswift/git_push.sh b/samples/client/petstore/swift/rxswift/git_push.sh index ae01b182ae..8442b80bb4 100644 --- a/samples/client/petstore/swift/rxswift/git_push.sh +++ b/samples/client/petstore/swift/rxswift/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift3/default/.openapi-generator/VERSION b/samples/client/petstore/swift3/default/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift3/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/default/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/PetstoreClient.podspec b/samples/client/petstore/swift3/default/PetstoreClient.podspec index 0245828f84..c8453cdd8e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/default/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'Alamofire', '~> 4.5.0' diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 96% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 4b90cfc5b4..d99d4858ff 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index fe0b1fffd2..c474dd4a9f 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift similarity index 63% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 0aa321fd65..7381be5eef 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -1,8 +1,8 @@ // // AnotherFakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (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 + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -26,17 +26,16 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift similarity index 75% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index df303ecf8c..8da34b09cf 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -1,8 +1,8 @@ // // FakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,7 +14,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -24,29 +24,28 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 outerComposite: (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: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -55,19 +54,14 @@ open class FakeAPI: APIBase { /** - 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) + - examples: [{contentType=*/*, example={ }}] + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -80,7 +74,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -90,19 +84,18 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } @@ -111,7 +104,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -121,30 +114,29 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 client: (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: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -154,17 +146,16 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -191,7 +182,7 @@ open class FakeAPI: APIBase { - 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: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> 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) } @@ -203,7 +194,7 @@ open class FakeAPI: APIBase { - POST /fake - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - - type: basic + - type: http - name: http_basic_test - parameter number: (form) None - parameter double: (form) None @@ -221,7 +212,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: RequestBuilder */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -251,23 +242,6 @@ open class FakeAPI: APIBase { 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 */ @@ -310,6 +284,23 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * 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 enumQueryDouble */ @@ -320,18 +311,18 @@ open class FakeAPI: APIBase { /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -341,18 +332,17 @@ open class FakeAPI: APIBase { 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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 { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -366,8 +356,8 @@ open class FakeAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -397,8 +387,6 @@ open class FakeAPI: APIBase { /** test json serialization of form data - GET /fake/jsonFormData - - - - parameter param: (form) field1 - parameter param2: (form) field2 - returns: RequestBuilder diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift similarity index 66% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index e9e41a3f98..29690f6197 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -1,8 +1,8 @@ // // FakeClassnameTags123API.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (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 + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -31,13 +31,13 @@ open class FakeClassnameTags123API: APIBase { - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 84% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 028e532fd8..3f9f338b1a 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -25,17 +25,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -60,7 +59,6 @@ open class PetAPI: APIBase { /** Deletes a pet - DELETE /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -115,7 +113,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -124,7 +138,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -140,24 +155,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -166,39 +164,7 @@ open class PetAPI: APIBase { 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]> */ @@ -236,7 +202,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -245,7 +227,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -261,24 +244,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -287,39 +253,7 @@ open class PetAPI: APIBase { 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]> */ @@ -357,16 +291,7 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}, {contentType=application/json, example={ + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -382,8 +307,7 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -392,7 +316,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -408,7 +333,16 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -429,11 +363,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -442,17 +376,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -478,7 +411,6 @@ open class PetAPI: APIBase { /** Updates a pet in the store with form data - POST /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -525,7 +457,6 @@ open class PetAPI: APIBase { /** uploads an image - POST /pet/{petId}/uploadImage - - - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index e089b64b9b..53c51f3e99 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -26,7 +26,6 @@ open class StoreAPI: APIBase { 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 */ @@ -63,9 +62,6 @@ open class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}] - returns: RequestBuilder<[String:Int32]> */ open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { @@ -96,37 +92,36 @@ open class StoreAPI: APIBase { 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" -}}] +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -147,11 +142,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (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: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -160,45 +155,43 @@ open class StoreAPI: APIBase { /** 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{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 +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 83% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0985efca95..c8f7c607c9 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -26,14 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -44,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -57,15 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -76,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -89,15 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -122,7 +117,6 @@ open class UserAPI: APIBase { 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 */ @@ -156,18 +150,7 @@ open class UserAPI: APIBase { /** 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={ + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -176,8 +159,7 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -186,7 +168,8 @@ open class UserAPI: APIBase { aeiou aeiou 123 -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -195,7 +178,16 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] +}}, {contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ @@ -230,12 +222,7 @@ open class UserAPI: APIBase { /** Logs user into the system - GET /user/login - - - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - responseHeaders: [X-Rate-Limit(Int32), 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 @@ -247,7 +234,7 @@ open class UserAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, + "username": username, "password": password ]) @@ -270,8 +257,6 @@ open class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ open class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -289,11 +274,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (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: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -303,18 +288,17 @@ open class UserAPI: APIBase { 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 + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 98% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 863f618326..5be6b2b08c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -296,8 +296,6 @@ open class AlamofireRequestBuilder: RequestBuilder { } return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(Response(response: response.response!, body: ("" as! T)), nil) return } diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift similarity index 80% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 7f777932fe..b9e2e49768 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -1,7 +1,7 @@ // Configuration.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 9ef05402fa..e83bfe67cb 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 95% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 0acd7ca42f..d1465fe4cb 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -498,6 +498,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) } } + // Decoder for [Cat] + Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in + return Decoders.decode(clazz: [Cat].self, source: source) + } + + // Decoder for Cat + Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Cat() : instance as! Cat + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -564,6 +599,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) } } + // Decoder for [Dog] + Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in + return Decoders.decode(clazz: [Dog].self, source: source) + } + + // Decoder for Dog + Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Dog() : instance as! Dog + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -695,7 +765,7 @@ class Decoders { case let .failure(error): break } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["binary"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { case let .success(value): _result.binary = value case let .failure(error): break @@ -767,7 +837,7 @@ class Decoders { let _result = instance == nil ? List() : instance as! List switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - case let .success(value): _result._123List = value + case let .success(value): _result._123list = value case let .failure(error): break } @@ -889,7 +959,7 @@ class Decoders { } switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - case let .success(value): _result._123Number = value + case let .success(value): _result._123number = value case let .failure(error): break } @@ -968,19 +1038,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) } } - // Decoder for [OuterBoolean] - Decoders.addDecoder(clazz: [OuterBoolean].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterBoolean]> in - return Decoders.decode(clazz: [OuterBoolean].self, source: source) - } - - // Decoder for OuterBoolean - Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterBoolean { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) - } - } // Decoder for [OuterComposite] Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in return Decoders.decode(clazz: [OuterComposite].self, source: source) @@ -990,19 +1047,19 @@ class Decoders { Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { case let .success(value): _result.myNumber = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { case let .success(value): _result.myString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { case let .success(value): _result.myBoolean = value case let .failure(error): break @@ -1023,32 +1080,6 @@ class Decoders { //TODO: I don't think we need this anymore return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) } - // Decoder for [OuterNumber] - Decoders.addDecoder(clazz: [OuterNumber].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterNumber]> in - return Decoders.decode(clazz: [OuterNumber].self, source: source) - } - - // Decoder for OuterNumber - Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterNumber { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) - } - } - // Decoder for [OuterString] - Decoders.addDecoder(clazz: [OuterString].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterString]> in - return Decoders.decode(clazz: [OuterString].self, source: source) - } - - // Decoder for OuterString - Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterString { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) - } - } // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in return Decoders.decode(clazz: [Pet].self, source: source) @@ -1253,76 +1284,6 @@ class Decoders { return .failure(.typeMismatch(expected: "User", actual: "\(source)")) } } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } }() static fileprivate func initialize() { diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift similarity index 88% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index fe333aaafa..48724b45a3 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // AdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 86% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index f9fd0e865c..c88f4c243e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -1,8 +1,8 @@ // // Animal.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 88% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index cad05c5b6d..5e71afe30e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -1,8 +1,8 @@ // // ApiResponse.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 86% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index d7870d7c01..117028338c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 85% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 01d3b17338..0ef1486af4 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 90% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index ef7b15bccd..7a6f225b4f 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -1,8 +1,8 @@ // // ArrayTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 92% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 6b7796e65e..7576f6e34e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -1,8 +1,8 @@ // // Capitalization.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift similarity index 84% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 910cd8119e..176f1d2cdc 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -1,8 +1,8 @@ // // Cat.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 86% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index ecc1b3b52d..f655cdfbd1 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0423f522ed..8bcb324654 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -1,8 +1,8 @@ // // ClassModel.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 83% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index d7a7038670..15911001e9 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -1,8 +1,8 @@ // // Client.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 84% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 36ea9b97b6..93fd2df434 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -1,8 +1,8 @@ // // Dog.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 90% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9bfe63ce1d..928449dfcb 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -1,8 +1,8 @@ // // EnumArrays.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift similarity index 71% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c72feaabbd..73a74ff53f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -1,8 +1,8 @@ // // EnumClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 93% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 2607822cb9..59c0660b90 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -1,8 +1,8 @@ // // EnumTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift similarity index 93% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index e4c1a85dbd..4e1ac02657 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -1,8 +1,8 @@ // // FormatTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -18,7 +18,7 @@ open class FormatTest: JSONEncodable { public var double: Double? public var string: String? public var byte: Data? - public var binary: Data? + public var binary: URL? public var date: ISOFullDate? public var dateTime: Date? public var uuid: UUID? diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 86% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index fc41604fc8..8b30c111de 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -1,8 +1,8 @@ // // HasOnlyReadOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift similarity index 66% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index bc30aa7469..2336d92501 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -1,8 +1,8 @@ // // List.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -10,14 +10,14 @@ import Foundation open class List: JSONEncodable { - public var _123List: String? + public var _123list: String? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123List + nillableDictionary["123-list"] = self._123list let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift similarity index 89% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index d2191dae66..58548bee74 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -1,8 +1,8 @@ // // MapTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 89% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c5a588c833..451a227525 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // MixedPropertiesAndAdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 87% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index ad20a8344b..4e5fe497d0 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -1,8 +1,8 @@ // // Model200Response.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 79% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 0a2a87ec56..56b9a73d3f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -1,8 +1,8 @@ // // Name.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,7 +14,7 @@ open class Name: JSONEncodable { public var name: Int32? public var snakeCase: Int32? public var property: String? - public var _123Number: Int32? + public var _123number: Int32? public init() {} @@ -24,7 +24,7 @@ open class Name: JSONEncodable { nillableDictionary["name"] = self.name?.encodeToJSON() nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123Number?.encodeToJSON() + nillableDictionary["123Number"] = self._123number?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 84% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 54a0a97d97..bbcf6dc330 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -1,8 +1,8 @@ // // NumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 92% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 26e64adf61..53615e31d1 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 0000000000..b346eb47e5 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,30 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber + nillableDictionary["my_string"] = self.myString + nillableDictionary["my_boolean"] = self.myBoolean + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift similarity index 73% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 3f6e50251e..29609ed651 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -1,8 +1,8 @@ // // OuterEnum.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 92% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 9930ae27da..5178567775 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index ca4945617a..2f169a9350 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -1,8 +1,8 @@ // // ReadOnlyFirst.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Return.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b0652f2d1b..ceac4d7366 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -1,8 +1,8 @@ // // Return.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 52fb9b1913..5c6dc68f54 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -1,8 +1,8 @@ // // SpecialModelName.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index eb865158c2..aacc34cb98 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 92% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index fc08160a90..a60b91ea67 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift deleted file mode 100644 index cf28bec4c8..0000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// Fake_classname_tags123API.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation -import Alamofire - - -open class Fake_classname_tags123API: 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 = URLComponents(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/FakeclassnametagsAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeclassnametagsAPI.swift deleted file mode 100644 index da708725b3..0000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeclassnametagsAPI.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// FakeclassnametagsAPI.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Alamofire - - - -open class FakeclassnametagsAPI: 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: 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 - - examples: [{contentType=application/json, example={ - "client" : "aeiou" -}}] - - - 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() as? [String:AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift deleted file mode 100644 index a24f9f6b14..0000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterBoolean.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterBoolean: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift deleted file mode 100644 index ddf8662245..0000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: OuterNumber? - public var myString: OuterString? - public var myBoolean: OuterBoolean? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() - nillableDictionary["my_string"] = self.myString?.encodeToJSON() - nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift deleted file mode 100644 index 64d8da6440..0000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterNumber.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterNumber: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift deleted file mode 100644 index a6ea38c804..0000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterString.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterString: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/git_push.sh b/samples/client/petstore/swift3/default/git_push.sh index 160f6f2139..20057f67ad 100644 --- a/samples/client/petstore/swift3/default/git_push.sh +++ b/samples/client/petstore/swift3/default/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec b/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec index 0245828f84..c8453cdd8e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'Alamofire', '~> 4.5.0' diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 96% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 4b90cfc5b4..d99d4858ff 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index fe0b1fffd2..c474dd4a9f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift similarity index 63% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 0aa321fd65..7381be5eef 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -1,8 +1,8 @@ // // AnotherFakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (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 + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -26,17 +26,16 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift similarity index 75% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index df303ecf8c..8da34b09cf 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -1,8 +1,8 @@ // // FakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,7 +14,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -24,29 +24,28 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 outerComposite: (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: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -55,19 +54,14 @@ open class FakeAPI: APIBase { /** - 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) + - examples: [{contentType=*/*, example={ }}] + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -80,7 +74,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -90,19 +84,18 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } @@ -111,7 +104,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -121,30 +114,29 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 client: (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: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -154,17 +146,16 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -191,7 +182,7 @@ open class FakeAPI: APIBase { - 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: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> 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) } @@ -203,7 +194,7 @@ open class FakeAPI: APIBase { - POST /fake - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - - type: basic + - type: http - name: http_basic_test - parameter number: (form) None - parameter double: (form) None @@ -221,7 +212,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: RequestBuilder */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -251,23 +242,6 @@ open class FakeAPI: APIBase { 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 */ @@ -310,6 +284,23 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * 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 enumQueryDouble */ @@ -320,18 +311,18 @@ open class FakeAPI: APIBase { /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -341,18 +332,17 @@ open class FakeAPI: APIBase { 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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 { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -366,8 +356,8 @@ open class FakeAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -397,8 +387,6 @@ open class FakeAPI: APIBase { /** test json serialization of form data - GET /fake/jsonFormData - - - - parameter param: (form) field1 - parameter param2: (form) field2 - returns: RequestBuilder diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift similarity index 66% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index e9e41a3f98..29690f6197 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -1,8 +1,8 @@ // // FakeClassnameTags123API.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (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 + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -31,13 +31,13 @@ open class FakeClassnameTags123API: APIBase { - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 84% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 028e532fd8..3f9f338b1a 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -25,17 +25,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -60,7 +59,6 @@ open class PetAPI: APIBase { /** Deletes a pet - DELETE /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -115,7 +113,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -124,7 +138,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -140,24 +155,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -166,39 +164,7 @@ open class PetAPI: APIBase { 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]> */ @@ -236,7 +202,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -245,7 +227,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -261,24 +244,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -287,39 +253,7 @@ open class PetAPI: APIBase { 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]> */ @@ -357,16 +291,7 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}, {contentType=application/json, example={ + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -382,8 +307,7 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -392,7 +316,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -408,7 +333,16 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -429,11 +363,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -442,17 +376,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -478,7 +411,6 @@ open class PetAPI: APIBase { /** Updates a pet in the store with form data - POST /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -525,7 +457,6 @@ open class PetAPI: APIBase { /** uploads an image - POST /pet/{petId}/uploadImage - - - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 85% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index e089b64b9b..53c51f3e99 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -26,7 +26,6 @@ open class StoreAPI: APIBase { 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 */ @@ -63,9 +62,6 @@ open class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}] - returns: RequestBuilder<[String:Int32]> */ open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { @@ -96,37 +92,36 @@ open class StoreAPI: APIBase { 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" -}}] +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -147,11 +142,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (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: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -160,45 +155,43 @@ open class StoreAPI: APIBase { /** 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{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 +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 83% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0985efca95..c8f7c607c9 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -26,14 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -44,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -57,15 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -76,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -89,15 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -122,7 +117,6 @@ open class UserAPI: APIBase { 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 */ @@ -156,18 +150,7 @@ open class UserAPI: APIBase { /** 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={ + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -176,8 +159,7 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -186,7 +168,8 @@ open class UserAPI: APIBase { aeiou aeiou 123 -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -195,7 +178,16 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] +}}, {contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ @@ -230,12 +222,7 @@ open class UserAPI: APIBase { /** Logs user into the system - GET /user/login - - - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - responseHeaders: [X-Rate-Limit(Int32), 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 @@ -247,7 +234,7 @@ open class UserAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, + "username": username, "password": password ]) @@ -270,8 +257,6 @@ open class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ open class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -289,11 +274,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (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: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -303,18 +288,17 @@ open class UserAPI: APIBase { 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 + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 98% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 863f618326..5be6b2b08c 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -296,8 +296,6 @@ open class AlamofireRequestBuilder: RequestBuilder { } return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(Response(response: response.response!, body: ("" as! T)), nil) return } diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift similarity index 80% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Configuration.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 7f777932fe..b9e2e49768 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Configuration.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -1,7 +1,7 @@ // Configuration.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 9ef05402fa..e83bfe67cb 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 95% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 0acd7ca42f..d1465fe4cb 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -498,6 +498,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) } } + // Decoder for [Cat] + Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in + return Decoders.decode(clazz: [Cat].self, source: source) + } + + // Decoder for Cat + Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Cat() : instance as! Cat + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -564,6 +599,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) } } + // Decoder for [Dog] + Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in + return Decoders.decode(clazz: [Dog].self, source: source) + } + + // Decoder for Dog + Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Dog() : instance as! Dog + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -695,7 +765,7 @@ class Decoders { case let .failure(error): break } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["binary"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { case let .success(value): _result.binary = value case let .failure(error): break @@ -767,7 +837,7 @@ class Decoders { let _result = instance == nil ? List() : instance as! List switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - case let .success(value): _result._123List = value + case let .success(value): _result._123list = value case let .failure(error): break } @@ -889,7 +959,7 @@ class Decoders { } switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - case let .success(value): _result._123Number = value + case let .success(value): _result._123number = value case let .failure(error): break } @@ -968,19 +1038,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) } } - // Decoder for [OuterBoolean] - Decoders.addDecoder(clazz: [OuterBoolean].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterBoolean]> in - return Decoders.decode(clazz: [OuterBoolean].self, source: source) - } - - // Decoder for OuterBoolean - Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterBoolean { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) - } - } // Decoder for [OuterComposite] Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in return Decoders.decode(clazz: [OuterComposite].self, source: source) @@ -990,19 +1047,19 @@ class Decoders { Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { case let .success(value): _result.myNumber = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { case let .success(value): _result.myString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { case let .success(value): _result.myBoolean = value case let .failure(error): break @@ -1023,32 +1080,6 @@ class Decoders { //TODO: I don't think we need this anymore return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) } - // Decoder for [OuterNumber] - Decoders.addDecoder(clazz: [OuterNumber].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterNumber]> in - return Decoders.decode(clazz: [OuterNumber].self, source: source) - } - - // Decoder for OuterNumber - Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterNumber { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) - } - } - // Decoder for [OuterString] - Decoders.addDecoder(clazz: [OuterString].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterString]> in - return Decoders.decode(clazz: [OuterString].self, source: source) - } - - // Decoder for OuterString - Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterString { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) - } - } // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in return Decoders.decode(clazz: [Pet].self, source: source) @@ -1253,76 +1284,6 @@ class Decoders { return .failure(.typeMismatch(expected: "User", actual: "\(source)")) } } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } }() static fileprivate func initialize() { diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift similarity index 88% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index fe333aaafa..48724b45a3 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // AdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 86% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index f9fd0e865c..c88f4c243e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -1,8 +1,8 @@ // // Animal.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift similarity index 52% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 6830836489..e7bea63f8e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -1,8 +1,8 @@ // // AnimalFarm.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 89% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 70144a1d7c..fca43b2a89 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -1,8 +1,8 @@ // // ApiResponse.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 86% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index d7870d7c01..117028338c 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 01d3b17338..0ef1486af4 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 90% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index ef7b15bccd..7a6f225b4f 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -1,8 +1,8 @@ // // ArrayTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 92% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 6b7796e65e..7576f6e34e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -1,8 +1,8 @@ // // Capitalization.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift similarity index 87% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 2b31a56b66..0c2ca10ffd 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -1,8 +1,8 @@ // // Cat.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 88% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 36c98074d0..f9d95964b7 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 85% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0423f522ed..8bcb324654 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -1,8 +1,8 @@ // // ClassModel.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 83% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index d7a7038670..15911001e9 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -1,8 +1,8 @@ // // Client.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 84% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 36ea9b97b6..93fd2df434 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -1,8 +1,8 @@ // // Dog.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 90% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9bfe63ce1d..928449dfcb 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -1,8 +1,8 @@ // // EnumArrays.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift similarity index 71% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c72feaabbd..73a74ff53f 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -1,8 +1,8 @@ // // EnumClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 93% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 2607822cb9..59c0660b90 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -1,8 +1,8 @@ // // EnumTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift similarity index 90% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index b186e0d5f2..099ecb1da5 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -1,8 +1,8 @@ // // FormatTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -29,6 +29,11 @@ open class FormatTest: JSONEncodable { } } 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 { @@ -43,7 +48,7 @@ open class FormatTest: JSONEncodable { } public var string: String? public var byte: Data? - public var binary: Data? + public var binary: URL? public var date: ISOFullDate? public var dateTime: Date? public var uuid: UUID? diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 86% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index fc41604fc8..8b30c111de 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -1,8 +1,8 @@ // // HasOnlyReadOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift similarity index 66% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/List.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index bc30aa7469..2336d92501 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -1,8 +1,8 @@ // // List.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -10,14 +10,14 @@ import Foundation open class List: JSONEncodable { - public var _123List: String? + public var _123list: String? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123List + nillableDictionary["123-list"] = self._123list let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift similarity index 89% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index d2191dae66..58548bee74 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -1,8 +1,8 @@ // // MapTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 89% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c5a588c833..451a227525 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // MixedPropertiesAndAdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 89% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7b5bbeec29..5b33281e04 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -1,8 +1,8 @@ // // Model200Response.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 77% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 4194f829b0..8c81ddd444 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -1,8 +1,8 @@ // // Name.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -24,10 +24,10 @@ open class Name: JSONEncodable { } } public var property: String? - public var _123Number: Int32? - public var _123NumberNum: NSNumber? { + public var _123number: Int32? + public var _123numberNum: NSNumber? { get { - return _123Number.map({ return NSNumber(value: $0) }) + return _123number.map({ return NSNumber(value: $0) }) } } @@ -39,7 +39,7 @@ open class Name: JSONEncodable { nillableDictionary["name"] = self.name?.encodeToJSON() nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123Number?.encodeToJSON() + nillableDictionary["123Number"] = self._123number?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 68% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 54a0a97d97..342d6796d8 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -1,8 +1,8 @@ // // NumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -11,6 +11,11 @@ import Foundation open class NumberOnly: JSONEncodable { public var justNumber: Double? + public var justNumberNum: NSNumber? { + get { + return justNumber.map({ return NSNumber(value: $0) }) + } + } public init() {} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 95% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 735fad0fac..281bead97e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 0000000000..b346eb47e5 --- /dev/null +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,30 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber + nillableDictionary["my_string"] = self.myString + nillableDictionary["my_boolean"] = self.myBoolean + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift similarity index 73% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 3f6e50251e..29609ed651 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -1,8 +1,8 @@ // // OuterEnum.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 93% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index be675c6a17..113b509379 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index ca4945617a..2f169a9350 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -1,8 +1,8 @@ // // ReadOnlyFirst.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 88% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 250769f71c..0f84bb9951 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -1,8 +1,8 @@ // // Return.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 88% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index ad8f30341a..3d11997c1f 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -1,8 +1,8 @@ // // SpecialModelName.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 88% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index d734712fc4..492591e562 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 94% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 68cda8599b..b9333dc44a 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift deleted file mode 100644 index bc4369df7a..0000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// Fake_classname_tags123API.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation -import Alamofire - - -open class Fake_classname_tags123API: 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/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift deleted file mode 100644 index a24f9f6b14..0000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterBoolean.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterBoolean: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift deleted file mode 100644 index ddf8662245..0000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: OuterNumber? - public var myString: OuterString? - public var myBoolean: OuterBoolean? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() - nillableDictionary["my_string"] = self.myString?.encodeToJSON() - nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift deleted file mode 100644 index 64d8da6440..0000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterNumber.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterNumber: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift deleted file mode 100644 index a6ea38c804..0000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterString.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterString: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/git_push.sh b/samples/client/petstore/swift3/objcCompatible/git_push.sh index 160f6f2139..20057f67ad 100644 --- a/samples/client/petstore/swift3/objcCompatible/git_push.sh +++ b/samples/client/petstore/swift3/objcCompatible/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec index 933aeb7d78..34ca76681f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 96% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 4b90cfc5b4..d99d4858ff 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift index fe0b1fffd2..c474dd4a9f 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift similarity index 64% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index b0c53c97e3..683c9d0075 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -1,8 +1,8 @@ // // AnotherFakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import PromiseKit open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (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 + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - returns: Promise */ - open class func testSpecialTags( body: Client) -> Promise { + open class func testSpecialTags( client: Client) -> Promise { let deferred = Promise.pending() - testSpecialTags(body: body) { data, error in + testSpecialTags(client: client) { data, error in if let error = error { deferred.reject(error) } else { @@ -43,17 +43,16 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift similarity index 74% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index fbb2420e4a..d44a3736c6 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -1,8 +1,8 @@ // // FakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -15,7 +15,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -23,10 +23,10 @@ open class FakeAPI: APIBase { /** - parameter body: (body) Input boolean as post body (optional) - - returns: Promise + - returns: Promise */ - open class func fakeOuterBooleanSerialize( body: OuterBoolean? = nil) -> Promise { - let deferred = Promise.pending() + open class func fakeOuterBooleanSerialize( body: Bool? = nil) -> Promise { + let deferred = Promise.pending() fakeOuterBooleanSerialize(body: body) { data, error in if let error = error { deferred.reject(error) @@ -40,40 +40,39 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 outerComposite: (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: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: Promise */ - open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise { + open class func fakeOuterCompositeSerialize( outerComposite: OuterComposite? = nil) -> Promise { let deferred = Promise.pending() - fakeOuterCompositeSerialize(body: body) { data, error in + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in if let error = error { deferred.reject(error) } else { @@ -86,19 +85,14 @@ open class FakeAPI: APIBase { /** - 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) + - examples: [{contentType=*/*, example={ }}] + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -111,7 +105,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -119,10 +113,10 @@ open class FakeAPI: APIBase { /** - parameter body: (body) Input number as post body (optional) - - returns: Promise + - returns: Promise */ - open class func fakeOuterNumberSerialize( body: OuterNumber? = nil) -> Promise { - let deferred = Promise.pending() + open class func fakeOuterNumberSerialize( body: Double? = nil) -> Promise { + let deferred = Promise.pending() fakeOuterNumberSerialize(body: body) { data, error in if let error = error { deferred.reject(error) @@ -136,19 +130,18 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } @@ -157,7 +150,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -165,10 +158,10 @@ open class FakeAPI: APIBase { /** - parameter body: (body) Input string as post body (optional) - - returns: Promise + - returns: Promise */ - open class func fakeOuterStringSerialize( body: OuterString? = nil) -> Promise { - let deferred = Promise.pending() + open class func fakeOuterStringSerialize( body: String? = nil) -> Promise { + let deferred = Promise.pending() fakeOuterStringSerialize(body: body) { data, error in if let error = error { deferred.reject(error) @@ -182,42 +175,41 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 client: (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: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: Promise */ - open class func testClientModel( body: Client) -> Promise { + open class func testClientModel( client: Client) -> Promise { let deferred = Promise.pending() - testClientModel(body: body) { data, error in + testClientModel(client: client) { data, error in if let error = error { deferred.reject(error) } else { @@ -231,17 +223,16 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -268,7 +259,7 @@ open class FakeAPI: APIBase { - 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: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> 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) } @@ -292,7 +283,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: Promise */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { + open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { let deferred = Promise.pending() testEndpointParameters(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) { error in if let error = error { @@ -309,7 +300,7 @@ open class FakeAPI: APIBase { - POST /fake - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - - type: basic + - type: http - name: http_basic_test - parameter number: (form) None - parameter double: (form) None @@ -327,7 +318,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: RequestBuilder */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -357,23 +348,6 @@ open class FakeAPI: APIBase { 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 */ @@ -416,6 +390,23 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * 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 enumQueryDouble */ @@ -426,37 +417,37 @@ open class FakeAPI: APIBase { /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (optional) - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Promise */ - 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) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() - testEnumParameters(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in if let error = error { deferred.reject(error) } else { @@ -470,18 +461,17 @@ open class FakeAPI: APIBase { 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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 { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -495,8 +485,8 @@ open class FakeAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -543,8 +533,6 @@ open class FakeAPI: APIBase { /** test json serialization of form data - GET /fake/jsonFormData - - - - parameter param: (form) field1 - parameter param2: (form) field2 - returns: RequestBuilder diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift similarity index 66% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 4529d8ec9c..0e328cd428 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -1,8 +1,8 @@ // // FakeClassnameTags123API.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import PromiseKit open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (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 + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - returns: Promise */ - open class func testClassname( body: Client) -> Promise { + open class func testClassname( client: Client) -> Promise { let deferred = Promise.pending() - testClassname(body: body) { data, error in + testClassname(client: client) { data, error in if let error = error { deferred.reject(error) } else { @@ -48,13 +48,13 @@ open class FakeClassnameTags123API: APIBase { - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 27578224d5..163556dcbf 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import PromiseKit open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func addPet( body: Pet) -> Promise { + open class func addPet( pet: Pet) -> Promise { let deferred = Promise.pending() - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -42,17 +42,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -94,7 +93,6 @@ open class PetAPI: APIBase { /** Deletes a pet - DELETE /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -165,7 +163,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -174,7 +188,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -190,24 +205,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -216,39 +214,7 @@ open class PetAPI: APIBase { 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]> */ @@ -302,7 +268,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -311,7 +293,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -327,24 +310,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -353,39 +319,7 @@ open class PetAPI: APIBase { 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]> */ @@ -439,16 +373,7 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}, {contentType=application/json, example={ + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -464,8 +389,7 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -474,7 +398,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -490,7 +415,16 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -511,23 +445,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func updatePet( body: Pet) -> Promise { + open class func updatePet( pet: Pet) -> Promise { let deferred = Promise.pending() - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -540,17 +474,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -594,7 +527,6 @@ open class PetAPI: APIBase { /** Updates a pet in the store with form data - POST /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -659,7 +591,6 @@ open class PetAPI: APIBase { /** uploads an image - POST /pet/{petId}/uploadImage - - - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 87% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 4d558989f8..500ceee9f4 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -43,7 +43,6 @@ open class StoreAPI: APIBase { 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 */ @@ -95,9 +94,6 @@ open class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}] - returns: RequestBuilder<[String:Int32]> */ open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { @@ -144,37 +140,36 @@ open class StoreAPI: APIBase { 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" -}}] +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -195,23 +190,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (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: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: Promise */ - open class func placeOrder( body: Order) -> Promise { + open class func placeOrder( order: Order) -> Promise { let deferred = Promise.pending() - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { deferred.reject(error) } else { @@ -224,45 +219,43 @@ open class StoreAPI: APIBase { /** 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{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 +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 83% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index de74a9a002..c1c06a892f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import PromiseKit open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: Promise */ - open class func createUser( body: User) -> Promise { + open class func createUser( user: User) -> Promise { let deferred = Promise.pending() - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -43,14 +43,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -61,23 +60,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Promise */ - open class func createUsersWithArrayInput( body: [User]) -> Promise { + open class func createUsersWithArrayInput( user: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -90,15 +89,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -109,23 +106,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Promise */ - open class func createUsersWithListInput( body: [User]) -> Promise { + open class func createUsersWithListInput( user: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -138,15 +135,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -187,7 +182,6 @@ open class UserAPI: APIBase { 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 */ @@ -237,18 +231,7 @@ open class UserAPI: APIBase { /** 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={ + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -257,8 +240,7 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -267,7 +249,8 @@ open class UserAPI: APIBase { aeiou aeiou 123 -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -276,7 +259,16 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] +}}, {contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ @@ -328,12 +320,7 @@ open class UserAPI: APIBase { /** Logs user into the system - GET /user/login - - - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - responseHeaders: [X-Rate-Limit(Int32), 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 @@ -345,7 +332,7 @@ open class UserAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, + "username": username, "password": password ]) @@ -383,8 +370,6 @@ open class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ open class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -402,11 +387,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (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: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -414,12 +399,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, body: User) -> Promise { + open class func updateUser( username: String, user: User) -> Promise { let deferred = Promise.pending() - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { deferred.reject(error) } else { @@ -433,18 +418,17 @@ open class UserAPI: APIBase { 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 + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 98% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 863f618326..5be6b2b08c 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -296,8 +296,6 @@ open class AlamofireRequestBuilder: RequestBuilder { } return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(Response(response: response.response!, body: ("" as! T)), nil) return } diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift similarity index 80% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Configuration.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 7f777932fe..b9e2e49768 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Configuration.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -1,7 +1,7 @@ // Configuration.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 4d2b40f918..a7b796c7fd 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 95% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index 0acd7ca42f..d1465fe4cb 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -498,6 +498,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) } } + // Decoder for [Cat] + Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in + return Decoders.decode(clazz: [Cat].self, source: source) + } + + // Decoder for Cat + Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Cat() : instance as! Cat + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -564,6 +599,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) } } + // Decoder for [Dog] + Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in + return Decoders.decode(clazz: [Dog].self, source: source) + } + + // Decoder for Dog + Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Dog() : instance as! Dog + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -695,7 +765,7 @@ class Decoders { case let .failure(error): break } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["binary"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { case let .success(value): _result.binary = value case let .failure(error): break @@ -767,7 +837,7 @@ class Decoders { let _result = instance == nil ? List() : instance as! List switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - case let .success(value): _result._123List = value + case let .success(value): _result._123list = value case let .failure(error): break } @@ -889,7 +959,7 @@ class Decoders { } switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - case let .success(value): _result._123Number = value + case let .success(value): _result._123number = value case let .failure(error): break } @@ -968,19 +1038,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) } } - // Decoder for [OuterBoolean] - Decoders.addDecoder(clazz: [OuterBoolean].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterBoolean]> in - return Decoders.decode(clazz: [OuterBoolean].self, source: source) - } - - // Decoder for OuterBoolean - Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterBoolean { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) - } - } // Decoder for [OuterComposite] Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in return Decoders.decode(clazz: [OuterComposite].self, source: source) @@ -990,19 +1047,19 @@ class Decoders { Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { case let .success(value): _result.myNumber = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { case let .success(value): _result.myString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { case let .success(value): _result.myBoolean = value case let .failure(error): break @@ -1023,32 +1080,6 @@ class Decoders { //TODO: I don't think we need this anymore return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) } - // Decoder for [OuterNumber] - Decoders.addDecoder(clazz: [OuterNumber].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterNumber]> in - return Decoders.decode(clazz: [OuterNumber].self, source: source) - } - - // Decoder for OuterNumber - Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterNumber { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) - } - } - // Decoder for [OuterString] - Decoders.addDecoder(clazz: [OuterString].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterString]> in - return Decoders.decode(clazz: [OuterString].self, source: source) - } - - // Decoder for OuterString - Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterString { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) - } - } // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in return Decoders.decode(clazz: [Pet].self, source: source) @@ -1253,76 +1284,6 @@ class Decoders { return .failure(.typeMismatch(expected: "User", actual: "\(source)")) } } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } }() static fileprivate func initialize() { diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift similarity index 88% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index fe333aaafa..48724b45a3 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // AdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 86% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index f9fd0e865c..c88f4c243e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -1,8 +1,8 @@ // // Animal.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift similarity index 52% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 6830836489..e7bea63f8e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -1,8 +1,8 @@ // // AnimalFarm.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 88% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index cad05c5b6d..5e71afe30e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -1,8 +1,8 @@ // // ApiResponse.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 86% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index d7870d7c01..117028338c 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 85% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 01d3b17338..0ef1486af4 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 90% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index ef7b15bccd..7a6f225b4f 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -1,8 +1,8 @@ // // ArrayTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 92% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 6b7796e65e..7576f6e34e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -1,8 +1,8 @@ // // Capitalization.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift similarity index 84% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 910cd8119e..176f1d2cdc 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -1,8 +1,8 @@ // // Cat.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 86% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index ecc1b3b52d..f655cdfbd1 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0423f522ed..8bcb324654 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -1,8 +1,8 @@ // // ClassModel.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 83% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index d7a7038670..15911001e9 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -1,8 +1,8 @@ // // Client.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 84% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 36ea9b97b6..93fd2df434 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -1,8 +1,8 @@ // // Dog.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 90% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9bfe63ce1d..928449dfcb 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -1,8 +1,8 @@ // // EnumArrays.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift similarity index 71% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c72feaabbd..73a74ff53f 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -1,8 +1,8 @@ // // EnumClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 93% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 2607822cb9..59c0660b90 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -1,8 +1,8 @@ // // EnumTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift similarity index 93% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index e4c1a85dbd..4e1ac02657 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -1,8 +1,8 @@ // // FormatTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -18,7 +18,7 @@ open class FormatTest: JSONEncodable { public var double: Double? public var string: String? public var byte: Data? - public var binary: Data? + public var binary: URL? public var date: ISOFullDate? public var dateTime: Date? public var uuid: UUID? diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 86% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index fc41604fc8..8b30c111de 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -1,8 +1,8 @@ // // HasOnlyReadOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift similarity index 66% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift index bc30aa7469..2336d92501 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -1,8 +1,8 @@ // // List.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -10,14 +10,14 @@ import Foundation open class List: JSONEncodable { - public var _123List: String? + public var _123list: String? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123List + nillableDictionary["123-list"] = self._123list let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift similarity index 89% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index d2191dae66..58548bee74 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -1,8 +1,8 @@ // // MapTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 89% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c5a588c833..451a227525 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // MixedPropertiesAndAdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 87% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index ad20a8344b..4e5fe497d0 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -1,8 +1,8 @@ // // Model200Response.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 79% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Name.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 0a2a87ec56..56b9a73d3f 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -1,8 +1,8 @@ // // Name.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,7 +14,7 @@ open class Name: JSONEncodable { public var name: Int32? public var snakeCase: Int32? public var property: String? - public var _123Number: Int32? + public var _123number: Int32? public init() {} @@ -24,7 +24,7 @@ open class Name: JSONEncodable { nillableDictionary["name"] = self.name?.encodeToJSON() nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123Number?.encodeToJSON() + nillableDictionary["123Number"] = self._123number?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 84% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 54a0a97d97..bbcf6dc330 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -1,8 +1,8 @@ // // NumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 92% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 26e64adf61..53615e31d1 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 0000000000..b346eb47e5 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,30 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber + nillableDictionary["my_string"] = self.myString + nillableDictionary["my_boolean"] = self.myBoolean + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift similarity index 73% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 3f6e50251e..29609ed651 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -1,8 +1,8 @@ // // OuterEnum.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 92% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 9930ae27da..5178567775 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 85% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index ca4945617a..2f169a9350 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -1,8 +1,8 @@ // // ReadOnlyFirst.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b0652f2d1b..ceac4d7366 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -1,8 +1,8 @@ // // Return.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 52fb9b1913..5c6dc68f54 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -1,8 +1,8 @@ // // SpecialModelName.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 85% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index eb865158c2..aacc34cb98 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 92% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift index fc08160a90..a60b91ea67 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift deleted file mode 100644 index 3b7ba8e483..0000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// Fake_classname_tags123API.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation -import Alamofire -import PromiseKit - - -open class Fake_classname_tags123API: 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/FakeclassnametagsAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeclassnametagsAPI.swift deleted file mode 100644 index aba80f31fe..0000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeclassnametagsAPI.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// FakeclassnametagsAPI.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Alamofire -import PromiseKit - - - -open class FakeclassnametagsAPI: 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: Error?) -> 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 - - examples: [{contentType=application/json, example={ - "client" : "aeiou" -}}] - - - 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() as? [String:AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift deleted file mode 100644 index a24f9f6b14..0000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterBoolean.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterBoolean: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift deleted file mode 100644 index ddf8662245..0000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: OuterNumber? - public var myString: OuterString? - public var myBoolean: OuterBoolean? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() - nillableDictionary["my_string"] = self.myString?.encodeToJSON() - nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift deleted file mode 100644 index 64d8da6440..0000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterNumber.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterNumber: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift deleted file mode 100644 index a6ea38c804..0000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterString.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterString: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/git_push.sh b/samples/client/petstore/swift3/promisekit/git_push.sh index 160f6f2139..20057f67ad 100644 --- a/samples/client/petstore/swift3/promisekit/git_push.sh +++ b/samples/client/petstore/swift3/promisekit/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec index ed2b13c74c..83e2df162e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'RxSwift', '3.6.1' diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 96% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 4b90cfc5b4..d99d4858ff 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -1,7 +1,7 @@ // APIHelper.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 96% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift index fe0b1fffd2..c474dd4a9f 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -1,7 +1,7 @@ // APIs.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift similarity index 65% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index fd794110da..3de3c12f94 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -1,8 +1,8 @@ // // AnotherFakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import RxSwift open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (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 + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - returns: Observable */ - open class func testSpecialTags(body: Client) -> Observable { + open class func testSpecialTags(client: Client) -> Observable { return Observable.create { observer -> Disposable in - testSpecialTags(body: body) { data, error in + testSpecialTags(client: client) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -45,17 +45,16 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift similarity index 75% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9d9ff36815..45aa13f036 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -1,8 +1,8 @@ // // FakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -15,7 +15,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -23,9 +23,9 @@ open class FakeAPI: APIBase { /** - parameter body: (body) Input boolean as post body (optional) - - returns: Observable + - returns: Observable */ - open class func fakeOuterBooleanSerialize(body: OuterBoolean? = nil) -> Observable { + open class func fakeOuterBooleanSerialize(body: Bool? = nil) -> Observable { return Observable.create { observer -> Disposable in fakeOuterBooleanSerialize(body: body) { data, error in if let error = error { @@ -42,40 +42,39 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 outerComposite: (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: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: Observable */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable { + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterCompositeSerialize(body: body) { data, error in + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -90,19 +89,14 @@ open class FakeAPI: APIBase { /** - 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) + - examples: [{contentType=*/*, example={ }}] + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -115,7 +109,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -123,9 +117,9 @@ open class FakeAPI: APIBase { /** - parameter body: (body) Input number as post body (optional) - - returns: Observable + - returns: Observable */ - open class func fakeOuterNumberSerialize(body: OuterNumber? = nil) -> Observable { + open class func fakeOuterNumberSerialize(body: Double? = nil) -> Observable { return Observable.create { observer -> Disposable in fakeOuterNumberSerialize(body: body) { data, error in if let error = error { @@ -142,19 +136,18 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } @@ -163,7 +156,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -171,9 +164,9 @@ open class FakeAPI: APIBase { /** - parameter body: (body) Input string as post body (optional) - - returns: Observable + - returns: Observable */ - open class func fakeOuterStringSerialize(body: OuterString? = nil) -> Observable { + open class func fakeOuterStringSerialize(body: String? = nil) -> Observable { return Observable.create { observer -> Disposable in fakeOuterStringSerialize(body: body) { data, error in if let error = error { @@ -190,42 +183,41 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 client: (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: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: Observable */ - open class func testClientModel(body: Client) -> Observable { + open class func testClientModel(client: Client) -> Observable { return Observable.create { observer -> Disposable in - testClientModel(body: body) { data, error in + testClientModel(client: client) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -241,17 +233,16 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -278,7 +269,7 @@ open class FakeAPI: APIBase { - 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: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> 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) } @@ -302,7 +293,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: Observable */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable { return Observable.create { observer -> Disposable in testEndpointParameters(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) { error in if let error = error { @@ -321,7 +312,7 @@ open class FakeAPI: APIBase { - POST /fake - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - - type: basic + - type: http - name: http_basic_test - parameter number: (form) None - parameter double: (form) None @@ -339,7 +330,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: RequestBuilder */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -369,23 +360,6 @@ open class FakeAPI: APIBase { 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 */ @@ -428,6 +402,23 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * 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 enumQueryDouble */ @@ -438,37 +429,37 @@ open class FakeAPI: APIBase { /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (optional) - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Observable */ - 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) -> Observable { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Observable { return Observable.create { observer -> Disposable in - testEnumParameters(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -484,18 +475,17 @@ open class FakeAPI: APIBase { 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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 { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -509,8 +499,8 @@ open class FakeAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -559,8 +549,6 @@ open class FakeAPI: APIBase { /** test json serialization of form data - GET /fake/jsonFormData - - - - parameter param: (form) field1 - parameter param2: (form) field2 - returns: RequestBuilder diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift similarity index 67% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 945db96a6e..b5e911d6c5 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -1,8 +1,8 @@ // // FakeClassnameTags123API.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import RxSwift open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (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 + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - returns: Observable */ - open class func testClassname(body: Client) -> Observable { + open class func testClassname(client: Client) -> Observable { return Observable.create { observer -> Disposable in - testClassname(body: body) { data, error in + testClassname(client: client) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -50,13 +50,13 @@ open class FakeClassnameTags123API: APIBase { - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 86% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 3d328b5587..708f9527b3 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import RxSwift open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func addPet(body: Pet) -> Observable { + open class func addPet(pet: Pet) -> Observable { return Observable.create { observer -> Disposable in - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -44,17 +44,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -98,7 +97,6 @@ open class PetAPI: APIBase { /** Deletes a pet - DELETE /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -171,7 +169,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -180,7 +194,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -196,24 +211,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -222,39 +220,7 @@ open class PetAPI: APIBase { 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]> */ @@ -310,7 +276,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -319,7 +301,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -335,24 +318,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -361,39 +327,7 @@ open class PetAPI: APIBase { 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]> */ @@ -449,16 +383,7 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}, {contentType=application/json, example={ + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -474,8 +399,7 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -484,7 +408,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -500,7 +425,16 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -521,23 +455,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func updatePet(body: Pet) -> Observable { + open class func updatePet(pet: Pet) -> Observable { return Observable.create { observer -> Disposable in - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -552,17 +486,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -608,7 +541,6 @@ open class PetAPI: APIBase { /** Updates a pet in the store with form data - POST /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -675,7 +607,6 @@ open class PetAPI: APIBase { /** uploads an image - POST /pet/{petId}/uploadImage - - - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 87% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f20ef73f3b..8ac4209dce 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -45,7 +45,6 @@ open class StoreAPI: APIBase { 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 */ @@ -99,9 +98,6 @@ open class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}] - returns: RequestBuilder<[String:Int32]> */ open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { @@ -150,37 +146,36 @@ open class StoreAPI: APIBase { 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" -}}] +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -201,23 +196,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (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: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: Observable */ - open class func placeOrder(body: Order) -> Observable { + open class func placeOrder(order: Order) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -232,45 +227,43 @@ open class StoreAPI: APIBase { /** 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{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 +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 84% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index d4b6542513..5c21da0031 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -13,23 +13,23 @@ import RxSwift open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: Observable */ - open class func createUser(body: User) -> Observable { + open class func createUser(user: User) -> Observable { return Observable.create { observer -> Disposable in - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -45,14 +45,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -63,23 +62,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Observable */ - open class func createUsersWithArrayInput(body: [User]) -> Observable { + open class func createUsersWithArrayInput(user: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -94,15 +93,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -113,23 +110,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Observable */ - open class func createUsersWithListInput(body: [User]) -> Observable { + open class func createUsersWithListInput(user: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -144,15 +141,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -195,7 +190,6 @@ open class UserAPI: APIBase { 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 */ @@ -247,18 +241,7 @@ open class UserAPI: APIBase { /** 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={ + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -267,8 +250,7 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -277,7 +259,8 @@ open class UserAPI: APIBase { aeiou aeiou 123 -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -286,7 +269,16 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] +}}, {contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ @@ -340,12 +332,7 @@ open class UserAPI: APIBase { /** Logs user into the system - GET /user/login - - - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - responseHeaders: [X-Rate-Limit(Int32), 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 @@ -357,7 +344,7 @@ open class UserAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, + "username": username, "password": password ]) @@ -397,8 +384,6 @@ open class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ open class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -416,11 +401,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (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: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -428,12 +413,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: Observable */ - open class func updateUser(username: String, body: User) -> Observable { + open class func updateUser(username: String, user: User) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -449,18 +434,17 @@ open class UserAPI: APIBase { 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 + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 98% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 863f618326..5be6b2b08c 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -1,7 +1,7 @@ // AlamofireImplementations.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -296,8 +296,6 @@ open class AlamofireRequestBuilder: RequestBuilder { } return } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 completion(Response(response: response.response!, body: ("" as! T)), nil) return } diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift similarity index 80% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Configuration.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 7f777932fe..b9e2e49768 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Configuration.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -1,7 +1,7 @@ // Configuration.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 9ef05402fa..e83bfe67cb 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 95% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index 0acd7ca42f..d1465fe4cb 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -498,6 +498,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) } } + // Decoder for [Cat] + Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in + return Decoders.decode(clazz: [Cat].self, source: source) + } + + // Decoder for Cat + Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Cat() : instance as! Cat + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -564,6 +599,41 @@ class Decoders { return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) } } + // Decoder for [Dog] + Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in + return Decoders.decode(clazz: [Dog].self, source: source) + } + + // Decoder for Dog + Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? Dog() : instance as! Dog + if decoders["\(Animal.self)"] != nil { + _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { + + case let .success(value): _result.className = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + + case let .success(value): _result.color = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -695,7 +765,7 @@ class Decoders { case let .failure(error): break } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["binary"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { case let .success(value): _result.binary = value case let .failure(error): break @@ -767,7 +837,7 @@ class Decoders { let _result = instance == nil ? List() : instance as! List switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - case let .success(value): _result._123List = value + case let .success(value): _result._123list = value case let .failure(error): break } @@ -889,7 +959,7 @@ class Decoders { } switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - case let .success(value): _result._123Number = value + case let .success(value): _result._123number = value case let .failure(error): break } @@ -968,19 +1038,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) } } - // Decoder for [OuterBoolean] - Decoders.addDecoder(clazz: [OuterBoolean].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterBoolean]> in - return Decoders.decode(clazz: [OuterBoolean].self, source: source) - } - - // Decoder for OuterBoolean - Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterBoolean { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) - } - } // Decoder for [OuterComposite] Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in return Decoders.decode(clazz: [OuterComposite].self, source: source) @@ -990,19 +1047,19 @@ class Decoders { Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { case let .success(value): _result.myNumber = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { case let .success(value): _result.myString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { case let .success(value): _result.myBoolean = value case let .failure(error): break @@ -1023,32 +1080,6 @@ class Decoders { //TODO: I don't think we need this anymore return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) } - // Decoder for [OuterNumber] - Decoders.addDecoder(clazz: [OuterNumber].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterNumber]> in - return Decoders.decode(clazz: [OuterNumber].self, source: source) - } - - // Decoder for OuterNumber - Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterNumber { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) - } - } - // Decoder for [OuterString] - Decoders.addDecoder(clazz: [OuterString].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterString]> in - return Decoders.decode(clazz: [OuterString].self, source: source) - } - - // Decoder for OuterString - Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterString { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) - } - } // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in return Decoders.decode(clazz: [Pet].self, source: source) @@ -1253,76 +1284,6 @@ class Decoders { return .failure(.typeMismatch(expected: "User", actual: "\(source)")) } } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } }() static fileprivate func initialize() { diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift similarity index 88% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index fe333aaafa..48724b45a3 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // AdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 86% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index f9fd0e865c..c88f4c243e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -1,8 +1,8 @@ // // Animal.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift similarity index 52% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 6830836489..e7bea63f8e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -1,8 +1,8 @@ // // AnimalFarm.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 88% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index cad05c5b6d..5e71afe30e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -1,8 +1,8 @@ // // ApiResponse.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 86% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index d7870d7c01..117028338c 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 85% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 01d3b17338..0ef1486af4 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 90% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index ef7b15bccd..7a6f225b4f 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -1,8 +1,8 @@ // // ArrayTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 92% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 6b7796e65e..7576f6e34e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -1,8 +1,8 @@ // // Capitalization.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift similarity index 84% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 910cd8119e..176f1d2cdc 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -1,8 +1,8 @@ // // Cat.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 86% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index ecc1b3b52d..f655cdfbd1 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 85% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0423f522ed..8bcb324654 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -1,8 +1,8 @@ // // ClassModel.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 83% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Client.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index d7a7038670..15911001e9 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -1,8 +1,8 @@ // // Client.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 84% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 36ea9b97b6..93fd2df434 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -1,8 +1,8 @@ // // Dog.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 90% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9bfe63ce1d..928449dfcb 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -1,8 +1,8 @@ // // EnumArrays.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift similarity index 71% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c72feaabbd..73a74ff53f 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -1,8 +1,8 @@ // // EnumClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 93% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 2607822cb9..59c0660b90 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -1,8 +1,8 @@ // // EnumTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift similarity index 93% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index e4c1a85dbd..4e1ac02657 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -1,8 +1,8 @@ // // FormatTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -18,7 +18,7 @@ open class FormatTest: JSONEncodable { public var double: Double? public var string: String? public var byte: Data? - public var binary: Data? + public var binary: URL? public var date: ISOFullDate? public var dateTime: Date? public var uuid: UUID? diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 86% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index fc41604fc8..8b30c111de 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -1,8 +1,8 @@ // // HasOnlyReadOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift similarity index 66% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift index bc30aa7469..2336d92501 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -1,8 +1,8 @@ // // List.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -10,14 +10,14 @@ import Foundation open class List: JSONEncodable { - public var _123List: String? + public var _123list: String? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123List + nillableDictionary["123-list"] = self._123list let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift similarity index 89% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index d2191dae66..58548bee74 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -1,8 +1,8 @@ // // MapTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 89% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c5a588c833..451a227525 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // MixedPropertiesAndAdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 87% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index ad20a8344b..4e5fe497d0 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -1,8 +1,8 @@ // // Model200Response.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 79% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 0a2a87ec56..56b9a73d3f 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -1,8 +1,8 @@ // // Name.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,7 +14,7 @@ open class Name: JSONEncodable { public var name: Int32? public var snakeCase: Int32? public var property: String? - public var _123Number: Int32? + public var _123number: Int32? public init() {} @@ -24,7 +24,7 @@ open class Name: JSONEncodable { nillableDictionary["name"] = self.name?.encodeToJSON() nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123Number?.encodeToJSON() + nillableDictionary["123Number"] = self._123number?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 84% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 54a0a97d97..bbcf6dc330 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -1,8 +1,8 @@ // // NumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 92% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 26e64adf61..53615e31d1 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 0000000000..b346eb47e5 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,30 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber + nillableDictionary["my_string"] = self.myString + nillableDictionary["my_boolean"] = self.myBoolean + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift similarity index 73% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 3f6e50251e..29609ed651 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -1,8 +1,8 @@ // // OuterEnum.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 92% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 9930ae27da..5178567775 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 85% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index ca4945617a..2f169a9350 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -1,8 +1,8 @@ // // ReadOnlyFirst.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 85% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b0652f2d1b..ceac4d7366 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -1,8 +1,8 @@ // // Return.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 85% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 52fb9b1913..5c6dc68f54 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -1,8 +1,8 @@ // // SpecialModelName.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 85% rename from samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index eb865158c2..aacc34cb98 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 92% rename from samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift index fc08160a90..a60b91ea67 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift deleted file mode 100644 index 9ea10ff443..0000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// Fake_classname_tags123API.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation -import Alamofire -import RxSwift - - -open class Fake_classname_tags123API: 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/Models/OuterBoolean.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift deleted file mode 100644 index a24f9f6b14..0000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterBoolean.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterBoolean: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift deleted file mode 100644 index ddf8662245..0000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: OuterNumber? - public var myString: OuterString? - public var myBoolean: OuterBoolean? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() - nillableDictionary["my_string"] = self.myString?.encodeToJSON() - nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift deleted file mode 100644 index 64d8da6440..0000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterNumber.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterNumber: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift deleted file mode 100644 index a6ea38c804..0000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// OuterString.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterString: JSONEncodable { - - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/git_push.sh b/samples/client/petstore/swift3/rxswift/git_push.sh index 160f6f2139..20057f67ad 100644 --- a/samples/client/petstore/swift3/rxswift/git_push.sh +++ b/samples/client/petstore/swift3/rxswift/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec b/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec index 0245828f84..c8453cdd8e 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'Alamofire', '~> 4.5.0' diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 0000000000..d99d4858ff --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,75 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +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 + if let value = item._value as? Array { + return value.map { (v) -> URLQueryItem in + URLQueryItem( + name: item._key, + value: v + ) + } + } else { + return [URLQueryItem( + name: item._key, + value: "\(item._value!)" + )] + } + } + .flatMap { $0 } + + if returnValues.isEmpty { return nil } + return returnValues + } +} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 0000000000..c474dd4a9f --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,77 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +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 APIBase { + func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { + let encoded: Any? = encodable?.encodeToJSON() + + if encoded! is [Any] { + var dictionary = [String:Any]() + for (index, item) in (encoded as! [Any]).enumerated() { + dictionary["\(index)"] = item + } + return dictionary + } else { + return encoded as? [String:Any] + } + } +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + public let parameters: Any? + public let isBody: Bool + public let method: String + public 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: 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 { + addHeader(name: header, value: value) + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } + + @discardableResult 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 getBuilder() -> RequestBuilder.Type +} + diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift similarity index 63% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 0aa321fd65..7381be5eef 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -1,8 +1,8 @@ // // AnotherFakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (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 + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -26,17 +26,16 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift similarity index 75% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index df303ecf8c..8da34b09cf 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -1,8 +1,8 @@ // // FakeAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,7 +14,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -24,29 +24,28 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 outerComposite: (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: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -55,19 +54,14 @@ open class FakeAPI: APIBase { /** - 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) + - examples: [{contentType=*/*, example={ }}] + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -80,7 +74,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -90,19 +84,18 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } @@ -111,7 +104,7 @@ open class FakeAPI: APIBase { - 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: ErrorResponse?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -121,30 +114,29 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - - examples: [{contentType=application/json, example={ }}] + - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder + - returns: RequestBuilder */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + 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 client: (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: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -154,17 +146,16 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -191,7 +182,7 @@ open class FakeAPI: APIBase { - 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: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> 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) } @@ -203,7 +194,7 @@ open class FakeAPI: APIBase { - POST /fake - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - - type: basic + - type: http - name: http_basic_test - parameter number: (form) None - parameter double: (form) None @@ -221,7 +212,7 @@ open class FakeAPI: APIBase { - parameter callback: (form) None (optional) - returns: RequestBuilder */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -251,23 +242,6 @@ open class FakeAPI: APIBase { 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 */ @@ -310,6 +284,23 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * 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 enumQueryDouble */ @@ -320,18 +311,18 @@ open class FakeAPI: APIBase { /** 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -341,18 +332,17 @@ open class FakeAPI: APIBase { 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 enumHeaderString: (header) Header parameter enum test (string) (optional) - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (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 { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ @@ -366,8 +356,8 @@ open class FakeAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ @@ -397,8 +387,6 @@ open class FakeAPI: APIBase { /** test json serialization of form data - GET /fake/jsonFormData - - - - parameter param: (form) field1 - parameter param2: (form) field2 - returns: RequestBuilder diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift similarity index 66% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index e9e41a3f98..29690f6197 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -1,8 +1,8 @@ // // FakeClassnameTags123API.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (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 + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -31,13 +31,13 @@ open class FakeClassnameTags123API: APIBase { - examples: [{contentType=application/json, example={ "client" : "client" }}] - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 84% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 028e532fd8..3f9f338b1a 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -1,8 +1,8 @@ // // PetAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -25,17 +25,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -60,7 +59,6 @@ open class PetAPI: APIBase { /** Deletes a pet - DELETE /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -115,7 +113,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -124,7 +138,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -140,24 +155,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -166,39 +164,7 @@ open class PetAPI: APIBase { 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]> */ @@ -236,7 +202,23 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/xml, example= + - examples: [{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" +}}, {contentType=application/xml, example= 123456789 doggie @@ -245,7 +227,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example=[ { +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -261,24 +244,7 @@ open class PetAPI: APIBase { "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= +}}, {contentType=application/xml, example= 123456789 doggie @@ -287,39 +253,7 @@ open class PetAPI: APIBase { 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]> */ @@ -357,16 +291,7 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}, {contentType=application/json, example={ + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -382,8 +307,7 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -392,7 +316,8 @@ open class PetAPI: APIBase { aeiou -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", "id" : 0, @@ -408,7 +333,16 @@ open class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}] +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -429,11 +363,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (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: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -442,17 +376,16 @@ open class PetAPI: APIBase { /** 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 + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -478,7 +411,6 @@ open class PetAPI: APIBase { /** Updates a pet in the store with form data - POST /pet/{petId} - - - OAuth: - type: oauth2 - name: petstore_auth @@ -525,7 +457,6 @@ open class PetAPI: APIBase { /** uploads an image - POST /pet/{petId}/uploadImage - - - OAuth: - type: oauth2 - name: petstore_auth diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 85% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index e089b64b9b..53c51f3e99 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -1,8 +1,8 @@ // // StoreAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -26,7 +26,6 @@ open class StoreAPI: APIBase { 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 */ @@ -63,9 +62,6 @@ open class StoreAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "key" : 0 -}}] - returns: RequestBuilder<[String:Int32]> */ open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { @@ -96,37 +92,36 @@ open class StoreAPI: APIBase { 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, "id" : 0, "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" -}}] +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -147,11 +142,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (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: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -160,45 +155,43 @@ open class StoreAPI: APIBase { /** 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={ + - examples: [{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= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}, {contentType=application/json, example={ +}] + - examples: [{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 +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 83% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0985efca95..c8f7c607c9 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -1,8 +1,8 @@ // // UserAPI.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -26,14 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -44,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -57,15 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -76,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (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: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -89,15 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - - - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -122,7 +117,6 @@ open class UserAPI: APIBase { 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 */ @@ -156,18 +150,7 @@ open class UserAPI: APIBase { /** 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={ + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -176,8 +159,7 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] - - examples: [{contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -186,7 +168,8 @@ open class UserAPI: APIBase { aeiou aeiou 123 -}, {contentType=application/json, example={ +}] + - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", "password" : "password", @@ -195,7 +178,16 @@ open class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}] +}}, {contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ @@ -230,12 +222,7 @@ open class UserAPI: APIBase { /** Logs user into the system - GET /user/login - - - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - responseHeaders: [X-Rate-Limit(Int32), 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 @@ -247,7 +234,7 @@ open class UserAPI: APIBase { var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, + "username": username, "password": password ]) @@ -270,8 +257,6 @@ open class UserAPI: APIBase { /** Logs out current logged in user session - GET /user/logout - - - - returns: RequestBuilder */ open class func logoutUserWithRequestBuilder() -> RequestBuilder { @@ -289,11 +274,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (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: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -303,18 +288,17 @@ open class UserAPI: APIBase { 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 + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift new file mode 100644 index 0000000000..5be6b2b08c --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -0,0 +1,374 @@ +// AlamofireImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } +} + +private struct SynchronizedDictionary { + + private var dictionary = [K: V]() + private let queue = DispatchQueue( + label: "SynchronizedDictionary", + qos: DispatchQoS.userInitiated, + attributes: [DispatchQueue.Attributes.concurrent], + autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, + target: nil + ) + + public subscript(key: K) -> V? { + get { + var value: V? + + queue.sync { + value = self.dictionary[key] + } + + return value + } + set { + queue.sync(flags: DispatchWorkItemFlags.barrier) { + self.dictionary[key] = newValue + } + } + } + +} + +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: 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 as? Parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> 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 ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + + 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 param! { + 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) + } + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + default: + fatalError("Unprocessable value \(v) with key \(k)") + } + } + }, 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.HttpError(statusCode: 415, data: nil, error: 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) + } + + } + + private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + managerStore[managerId] = nil + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: 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.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: 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.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data 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.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) + } catch let error { + completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) + } + return + }) + default: + validatedRequest.responseJSON(options: .allowFragments) { response in + cleanupRequest() + + if response.result.isFailure { + completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) + return + } + + // handle HTTP 204 No Content + // NSNull would crash decoders + if response.response?.statusCode == 204 && response.result.value is NSNull{ + completion(nil, nil) + return + } + + if () is T { + completion(Response(response: response.response!, body: (() as! T)), nil) + return + } + if let json: Any = response.result.value { + let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) + switch decoded { + case let .success(object): completion(Response(response: response.response!, body: object), nil) + case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) + } + return + } else if "" is T { + completion(Response(response: response.response!, body: ("" as! T)), nil) + return + } + + completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) + } + } + } + + 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 = URLComponents(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 +} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 0000000000..b9e2e49768 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +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" + +} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 98% rename from samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 9ef05402fa..e83bfe67cb 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -1,7 +1,7 @@ // Extensions.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 95% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift index 892e7e4a79..ae32e6fab1 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -1,7 +1,7 @@ // Models.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -464,6 +464,34 @@ class Decoders { return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) } } + // Decoder for [Cat] + Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in + return Decoders.decode(clazz: [Cat].self, source: source) + } + + // Decoder for Cat + Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + guard let classNameSource = sourceDictionary["className"] as AnyObject? else { + return .failure(.missingKey(key: "className")) + } + guard let className = Decoders.decode(clazz: String.self.self, source: classNameSource).value else { + return .failure(.typeMismatch(expected: "Cat", actual: "\(classNameSource)")) + } + let _result = Cat(className: className) + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + case let .success(value): _result.color = value + case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + case let .success(value): _result.declawed = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -522,6 +550,34 @@ class Decoders { return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) } } + // Decoder for [Dog] + Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in + return Decoders.decode(clazz: [Dog].self, source: source) + } + + // Decoder for Dog + Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + guard let classNameSource = sourceDictionary["className"] as AnyObject? else { + return .failure(.missingKey(key: "className")) + } + guard let className = Decoders.decode(clazz: String.self.self, source: classNameSource).value else { + return .failure(.typeMismatch(expected: "Dog", actual: "\(classNameSource)")) + } + let _result = Dog(className: className) + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { + case let .success(value): _result.color = value + case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + case let .success(value): _result.breed = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -641,7 +697,7 @@ class Decoders { case let .success(value): _result.string = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["binary"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { case let .success(value): _result.binary = value case let .failure(error): break } @@ -690,7 +746,7 @@ class Decoders { if let sourceDictionary = source as? [AnyHashable: Any] { let _result = List() switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - case let .success(value): _result._123List = value + case let .success(value): _result._123list = value case let .failure(error): break } return .success(_result) @@ -792,7 +848,7 @@ class Decoders { case let .failure(error): break } switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - case let .success(value): _result._123Number = value + case let .success(value): _result._123number = value case let .failure(error): break } return .success(_result) @@ -856,19 +912,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) } } - // Decoder for [OuterBoolean] - Decoders.addDecoder(clazz: [OuterBoolean].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterBoolean]> in - return Decoders.decode(clazz: [OuterBoolean].self, source: source) - } - - // Decoder for OuterBoolean - Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterBoolean { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) - } - } // Decoder for [OuterComposite] Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in return Decoders.decode(clazz: [OuterComposite].self, source: source) @@ -878,15 +921,15 @@ class Decoders { Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = OuterComposite() - switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { case let .success(value): _result.myNumber = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { case let .success(value): _result.myString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { case let .success(value): _result.myBoolean = value case let .failure(error): break } @@ -905,32 +948,6 @@ class Decoders { //TODO: I don't think we need this anymore return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) } - // Decoder for [OuterNumber] - Decoders.addDecoder(clazz: [OuterNumber].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterNumber]> in - return Decoders.decode(clazz: [OuterNumber].self, source: source) - } - - // Decoder for OuterNumber - Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterNumber { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) - } - } - // Decoder for [OuterString] - Decoders.addDecoder(clazz: [OuterString].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterString]> in - return Decoders.decode(clazz: [OuterString].self, source: source) - } - - // Decoder for OuterString - Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let source = source as? OuterString { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) - } - } // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in return Decoders.decode(clazz: [Pet].self, source: source) @@ -1099,62 +1116,6 @@ class Decoders { return .failure(.typeMismatch(expected: "User", actual: "\(source)")) } } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - guard let classNameSource = sourceDictionary["className"] as AnyObject? else { - return .failure(.missingKey(key: "className")) - } - guard let className = Decoders.decode(clazz: String.self.self, source: classNameSource).value else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(classNameSource)")) - } - let _result = Cat(className: className) - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - case let .success(value): _result.color = value - case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - case let .success(value): _result.declawed = value - case let .failure(error): break - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - guard let classNameSource = sourceDictionary["className"] as AnyObject? else { - return .failure(.missingKey(key: "className")) - } - guard let className = Decoders.decode(clazz: String.self.self, source: classNameSource).value else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(classNameSource)")) - } - let _result = Dog(className: className) - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - case let .success(value): _result.color = value - case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - case let .success(value): _result.breed = value - case let .failure(error): break - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } }() static fileprivate func initialize() { diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift similarity index 90% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 10ca73b93e..c36f0571b3 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // AdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 88% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Animal.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index dedaff0b3b..97896fa392 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -1,8 +1,8 @@ // // Animal.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift similarity index 52% rename from samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 6830836489..e7bea63f8e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -1,8 +1,8 @@ // // AnimalFarm.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 90% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ac30970ded..37b5e5b6e1 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -1,8 +1,8 @@ // // ApiResponse.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index b3a1af6be3..b91012dae9 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 86% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index ca7f446e58..6aea892405 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -1,8 +1,8 @@ // // ArrayOfNumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 92% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 057664db01..ba65a7a9d7 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -1,8 +1,8 @@ // // ArrayTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 94% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 7ebbfabce7..a7832c805f 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -1,8 +1,8 @@ // // Capitalization.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Cat.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index fbbea3c063..29d48567ab 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -1,8 +1,8 @@ // // Cat.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index bd329efee4..61d01b5e09 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -1,8 +1,8 @@ // // Category.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0606046cac..08e922901f 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -1,8 +1,8 @@ // // ClassModel.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 85% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Client.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 3bc27d82bb..e269311644 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -1,8 +1,8 @@ // // Client.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 86% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Dog.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 2ce338f983..af87de78f4 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -1,8 +1,8 @@ // // Dog.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 91% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 79716c2c62..f1a9924c8e 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -1,8 +1,8 @@ // // EnumArrays.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift new file mode 100644 index 0000000000..73a74ff53f --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -0,0 +1,17 @@ +// +// EnumClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum EnumClass: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + + func encodeToJSON() -> Any { return self.rawValue } +} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 94% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 840c0e768d..896b7d33b2 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -1,8 +1,8 @@ // // EnumTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift similarity index 89% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index ded02dd241..15fc27c6c0 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -1,8 +1,8 @@ // // FormatTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -18,14 +18,14 @@ open class FormatTest: JSONEncodable { public var double: Double? public var string: String? public var byte: Data - public var binary: Data? + public var binary: URL? public var date: ISOFullDate public var dateTime: Date? public var uuid: UUID? public var password: String - public init(integer: Int32?=nil, int32: Int32?=nil, int64: Int64?=nil, number: Double, float: Float?=nil, double: Double?=nil, string: String?=nil, byte: Data, binary: Data?=nil, date: ISOFullDate, dateTime: Date?=nil, uuid: UUID?=nil, password: String) { + public init(integer: Int32?=nil, int32: Int32?=nil, int64: Int64?=nil, number: Double, float: Float?=nil, double: Double?=nil, string: String?=nil, byte: Data, binary: URL?=nil, date: ISOFullDate, dateTime: Date?=nil, uuid: UUID?=nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 8067c02bb2..a8c92e3c63 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -1,8 +1,8 @@ // // HasOnlyReadOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift new file mode 100644 index 0000000000..5f6850d558 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -0,0 +1,28 @@ +// +// List.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class List: JSONEncodable { + + public var _123list: String? + + + public init(_123list: String?=nil) { + self._123list = _123list + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["123-list"] = self._123list + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift similarity index 91% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/MapTest.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index fff7a0c0bd..8e8ff89249 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -1,8 +1,8 @@ // // MapTest.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 91% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 1d01501b25..8950fd0dff 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -1,8 +1,8 @@ // // MixedPropertiesAndAdditionalPropertiesClass.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 89% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index d610e50f98..f8848eb2c2 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -1,8 +1,8 @@ // // Model200Response.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 76% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Name.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index f090f0da44..e7516a9de7 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -1,8 +1,8 @@ // // Name.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation @@ -14,14 +14,14 @@ open class Name: JSONEncodable { public var name: Int32 public var snakeCase: Int32? public var property: String? - public var _123Number: Int32? + public var _123number: Int32? - public init(name: Int32, snakeCase: Int32?=nil, property: String?=nil, _123Number: Int32?=nil) { + public init(name: Int32, snakeCase: Int32?=nil, property: String?=nil, _123number: Int32?=nil) { self.name = name self.snakeCase = snakeCase self.property = property - self._123Number = _123Number + self._123number = _123number } // MARK: JSONEncodable open func encodeToJSON() -> Any { @@ -29,7 +29,7 @@ open class Name: JSONEncodable { nillableDictionary["name"] = self.name.encodeToJSON() nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123Number?.encodeToJSON() + nillableDictionary["123Number"] = self._123number?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 86% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index bf4b4a85d5..5d5351f5bb 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -1,8 +1,8 @@ // // NumberOnly.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 94% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index b347a6c76c..1406fc0935 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -1,8 +1,8 @@ // // Order.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 0000000000..8a9246536f --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,34 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + + public init(myNumber: Double?=nil, myString: String?=nil, myBoolean: Bool?=nil) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber + nillableDictionary["my_string"] = self.myString + nillableDictionary["my_boolean"] = self.myBoolean + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} + diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift new file mode 100644 index 0000000000..29609ed651 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -0,0 +1,17 @@ +// +// OuterEnum.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum OuterEnum: String { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + + func encodeToJSON() -> Any { return self.rawValue } +} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 94% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 864a69f10d..23806a1afa 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -1,8 +1,8 @@ // // Pet.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index e205b2c852..4ec4fa8ec7 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -1,8 +1,8 @@ // // ReadOnlyFirst.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 86% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Return.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 95443a6b33..052f8ff877 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -1,8 +1,8 @@ // // Return.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index fe55ea7b2d..54b641849c 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -1,8 +1,8 @@ // // SpecialModelName.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 87% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 38a82e2de1..29d070ffeb 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -1,8 +1,8 @@ // // Tag.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 94% rename from samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f891b676f3..3a8555c104 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -1,8 +1,8 @@ // // User.swift // -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen +// Generated by openapi-generator +// https://openapi-generator.tech // import Foundation diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIHelper.swift deleted file mode 100644 index 4b90cfc5b4..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// 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 - if let value = item._value as? Array { - return value.map { (v) -> URLQueryItem in - URLQueryItem( - name: item._key, - value: v - ) - } - } else { - return [URLQueryItem( - name: item._key, - value: "\(item._value!)" - )] - } - } - .flatMap { $0 } - - if returnValues.isEmpty { return nil } - return returnValues - } -} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift deleted file mode 100644 index fe0b1fffd2..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift +++ /dev/null @@ -1,77 +0,0 @@ -// 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 APIBase { - func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { - let encoded: Any? = encodable?.encodeToJSON() - - if encoded! is [Any] { - var dictionary = [String:Any]() - for (index, item) in (encoded as! [Any]).enumerated() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:Any] - } - } -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - public let parameters: Any? - public let isBody: Bool - public let method: String - public 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: 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 { - addHeader(name: header, value: value) - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } - - @discardableResult 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 getBuilder() -> RequestBuilder.Type -} - diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift deleted file mode 100644 index bc4369df7a..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// Fake_classname_tags123API.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation -import Alamofire - - -open class Fake_classname_tags123API: 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/AlamofireImplementations.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift deleted file mode 100644 index 863f618326..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ /dev/null @@ -1,376 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - -} - -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: 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 as? Parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> 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 ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - - 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 param! { - 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) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, 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.HttpError(statusCode: 415, data: nil, error: 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) - } - - } - - private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: 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.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: 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.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data 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.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) - } catch let error { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) - } - return - }) - default: - validatedRequest.responseJSON(options: .allowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) - return - } - - // handle HTTP 204 No Content - // NSNull would crash decoders - if response.response?.statusCode == 204 && response.result.value is NSNull{ - completion(nil, nil) - return - } - - if () is T { - completion(Response(response: response.response!, body: (() as! T)), nil) - return - } - if let json: Any = response.result.value { - let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) - switch decoded { - case let .success(object): completion(Response(response: response.response!, body: object), nil) - case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) - } - return - } else if "" is T { - // swagger-parser currently doesn't support void, which will be fixed in future swagger-parser release - // https://github.com/swagger-api/swagger-parser/pull/34 - completion(Response(response: response.response!, body: ("" as! T)), nil) - return - } - - completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - 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 = URLComponents(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 -} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Configuration.swift deleted file mode 100644 index 7f777932fe..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// 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" - -} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift deleted file mode 100644 index 6830836489..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// 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/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift deleted file mode 100644 index c72feaabbd..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// EnumClass.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public enum EnumClass: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/List.swift deleted file mode 100644 index e70eb5883b..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/List.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// List.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class List: JSONEncodable { - - public var _123List: String? - - - public init(_123List: String?=nil) { - self._123List = _123List - } - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123List - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift deleted file mode 100644 index ddf2b7af22..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// OuterBoolean.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterBoolean: JSONEncodable { - - - - public init() { - } - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift deleted file mode 100644 index e0d04d99d5..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: OuterNumber? - public var myString: OuterString? - public var myBoolean: OuterBoolean? - - - public init(myNumber: OuterNumber?=nil, myString: OuterString?=nil, myBoolean: OuterBoolean?=nil) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() - nillableDictionary["my_string"] = self.myString?.encodeToJSON() - nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift deleted file mode 100644 index 3f6e50251e..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -public enum OuterEnum: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift deleted file mode 100644 index 7f450dcd9f..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// OuterNumber.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterNumber: JSONEncodable { - - - - public init() { - } - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterString.swift deleted file mode 100644 index 77e9e301f8..0000000000 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// OuterString.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - -open class OuterString: JSONEncodable { - - - - public init() { - } - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/unwraprequired/git_push.sh b/samples/client/petstore/swift3/unwraprequired/git_push.sh index 160f6f2139..20057f67ad 100644 --- a/samples/client/petstore/swift3/unwraprequired/git_push.sh +++ b/samples/client/petstore/swift3/unwraprequired/git_push.sh @@ -1,7 +1,7 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift4/default/PetstoreClient.podspec b/samples/client/petstore/swift4/default/PetstoreClient.podspec index 0245828f84..c8453cdd8e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/default/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'Alamofire', '~> 4.5.0' diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIHelper.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/CodableHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/CodableHelper.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Configuration.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Extensions.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift new file mode 100644 index 0000000000..e7bea63f8e --- /dev/null +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -0,0 +1,11 @@ +// +// AnimalFarm.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Category.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Client.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/List.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Name.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Order.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Return.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift similarity index 100% rename from samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/User.swift rename to samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift deleted file mode 100644 index 35c9e383fa..0000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// 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/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift deleted file mode 100644 index 204acfe70c..0000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// OuterBoolean.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - - -public struct OuterBoolean: Codable { - - - - -} - 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 deleted file mode 100644 index 3e3a6775a6..0000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// OuterNumber.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - - -public struct OuterNumber: Codable { - - - - -} - 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 deleted file mode 100644 index 06ff5ccef4..0000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// OuterString.swift -// -// Generated by swagger-codegen -// https://github.com/swagger-api/swagger-codegen -// - -import Foundation - - - -public struct OuterString: Codable { - - - - -} -