From 43f7134b157fd668a0ed97e7d8cf5147c0d64064 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Mon, 18 May 2020 02:39:40 +0100 Subject: [PATCH] [swift] improve combine available and openapi3 deprecated (#6340) --- .../openapi-generator/src/main/resources/swift5/api.mustache | 2 -- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 36b6f9d23f6..f8154e47b77 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -144,9 +144,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{^isDeprecated}} @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error> { return Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error>.init { promisse in {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute(apiResponseQueue) { result -> Void in diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 7abcf9ce5a3..309ee4e9686 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -165,6 +165,7 @@ open class PetAPI { - returns: AnyPublisher<[Pet], Error> */ @available(*, deprecated, message: "This operation is deprecated.") + @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { return Future<[Pet], Error>.init { promisse in findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in