From 9779139d2110043bb105ff654f31e2b80851d6fc Mon Sep 17 00:00:00 2001 From: David Hunter Date: Tue, 12 May 2026 12:34:21 -0600 Subject: [PATCH] fix date encoding in path params in swift5 --- .../src/main/resources/swift5/api.mustache | 2 +- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift | 10 +++++----- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 4 ++-- .../PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift | 6 +++--- .../Sources/PetstoreClient/APIs/PetAPI.swift | 10 +++++----- .../Sources/PetstoreClient/APIs/StoreAPI.swift | 4 ++-- .../Sources/PetstoreClient/APIs/UserAPI.swift | 6 +++--- 28 files changed, 91 insertions(+), 91 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index f39aaddb2b4e..f1516e8b11e7 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -401,7 +401,7 @@ extension {{projectName}}API { {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> RequestBuilder<{{{returnType}}}{{#returnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{#-first}}var{{/-first}}{{/pathParams}} localVariablePath = "{{{path}}}"{{#pathParams}} - let {{paramName}}PreEscape = "\({{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}APIHelper.mapValueToPathItem({{paramName}}){{/isEnum}})" + let {{paramName}}PreEscape = "\({{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}APIHelper.mapValueToPathItem({{paramName}}.encodeToJSON()){{/isEnum}})" let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}} let localVariableURLString = {{projectName}}API.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 747cb1406a87..8153b03d7364 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -93,7 +93,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -254,7 +254,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -353,7 +353,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -412,7 +412,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -471,7 +471,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index ad60d97fa921..6dd5508c0bcd 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -40,7 +40,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -132,7 +132,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 5072c1f1daea..55f0b8d7dedf 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -170,7 +170,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -216,7 +216,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -356,7 +356,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index dfefa61d1d58..b094762260a7 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -77,7 +77,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -214,7 +214,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -297,7 +297,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -348,7 +348,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -399,7 +399,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 6d59ddefaf93..a7a5a19846a7 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -32,7 +32,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -108,7 +108,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 01fab8835f9e..1e514ad5d415 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -138,7 +138,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -176,7 +176,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -292,7 +292,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath 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 b206cde011e3..36cbf6c8ede3 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 @@ -114,7 +114,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -302,7 +302,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -419,7 +419,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -487,7 +487,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -555,7 +555,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 39a891ae8684..7c388f70b0a9 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -52,7 +52,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -162,7 +162,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index e5797abfc813..08e82a24f212 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -209,7 +209,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -264,7 +264,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -431,7 +431,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 9d32596ac814..08e39fc7afbd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -90,7 +90,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -251,7 +251,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -350,7 +350,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -409,7 +409,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -468,7 +468,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index ad60d97fa921..6dd5508c0bcd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -40,7 +40,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -132,7 +132,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 5072c1f1daea..55f0b8d7dedf 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -170,7 +170,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -216,7 +216,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -356,7 +356,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 5510610fcd5b..bd00627c3c28 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -93,7 +93,7 @@ import AnyCodable */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -254,7 +254,7 @@ import AnyCodable */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -353,7 +353,7 @@ import AnyCodable */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -412,7 +412,7 @@ import AnyCodable */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -471,7 +471,7 @@ import AnyCodable */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index c1d6a5594704..30abbc9aca6a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -40,7 +40,7 @@ import AnyCodable */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -132,7 +132,7 @@ import AnyCodable */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index b19a47fee245..eea948a735e0 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -170,7 +170,7 @@ import AnyCodable */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -216,7 +216,7 @@ import AnyCodable */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -356,7 +356,7 @@ import AnyCodable */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index c2813aa9f6ed..6591d2ee4ba3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -94,7 +94,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -255,7 +255,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -354,7 +354,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -413,7 +413,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -472,7 +472,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index bcba455ea172..148b5a02140e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -41,7 +41,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -133,7 +133,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 611917e6ad8a..636c8ae7d1ac 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -171,7 +171,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -217,7 +217,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -357,7 +357,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 9c18968b6567..15c18063bf43 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -93,7 +93,7 @@ internal class PetAPI { */ internal class func deletePetWithRequestBuilder(apiKey: String? = nil, petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -254,7 +254,7 @@ internal class PetAPI { */ internal class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -353,7 +353,7 @@ internal class PetAPI { */ internal class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -412,7 +412,7 @@ internal class PetAPI { */ internal class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -471,7 +471,7 @@ internal class PetAPI { */ internal class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 9943aca53a99..4f8bc2819876 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -40,7 +40,7 @@ internal class StoreAPI { */ internal class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -132,7 +132,7 @@ internal class StoreAPI { */ internal class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index ca6bcf255495..2f4a3b1be2cd 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -170,7 +170,7 @@ internal class UserAPI { */ internal class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -216,7 +216,7 @@ internal class UserAPI { */ internal class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -356,7 +356,7 @@ internal class UserAPI { */ internal class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 161cac524b57..436ab3603dec 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -106,7 +106,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -285,7 +285,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -396,7 +396,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -461,7 +461,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -526,7 +526,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 7a24e880f617..1b2942b1a614 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -47,7 +47,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -151,7 +151,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 9ab47031b60f..573065d3d1f9 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -195,7 +195,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -247,7 +247,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -405,7 +405,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 3741d7f42773..71d4e3c2e1d1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -96,7 +96,7 @@ open class PetAPI { */ open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -257,7 +257,7 @@ open class PetAPI { */ open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -356,7 +356,7 @@ open class PetAPI { */ open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -415,7 +415,7 @@ open class PetAPI { */ open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { var localVariablePath = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -474,7 +474,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId.encodeToJSON()))" let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 7eca4142f5fe..5ad1a3e88e8f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -43,7 +43,7 @@ open class StoreAPI { */ open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -135,7 +135,7 @@ open class StoreAPI { */ open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { var localVariablePath = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId.encodeToJSON()))" let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 77dc9bfdbd50..e74ad61618b1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -173,7 +173,7 @@ open class UserAPI { */ open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -219,7 +219,7 @@ open class UserAPI { */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath @@ -359,7 +359,7 @@ open class UserAPI { */ open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var localVariablePath = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username.encodeToJSON()))" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath