mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-01 06:20:53 +00:00
Use percent encoding for path parameters (#2649)
This commit is contained in:
parent
85d05981ec
commit
7af94fa1e8
@ -31,7 +31,7 @@ void
|
||||
{{#pathParams}}
|
||||
QString {{paramName}}PathParam("{");
|
||||
{{paramName}}PathParam.append("{{baseName}}").append("}");
|
||||
fullPath.replace({{paramName}}PathParam, ::{{cppNamespace}}::toStringValue({{paramName}}));
|
||||
fullPath.replace({{paramName}}PathParam, QUrl::toPercentEncoding(::{{cppNamespace}}::toStringValue({{paramName}})));
|
||||
{{/pathParams}}
|
||||
{{#queryParams}}{{^collectionFormat}}
|
||||
if (fullPath.indexOf("?") > 0)
|
||||
|
@ -85,7 +85,7 @@ OAIPetApi::deletePet(const qint64& pet_id, const QString& api_key) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
QString pet_idPathParam("{");
|
||||
pet_idPathParam.append("petId").append("}");
|
||||
fullPath.replace(pet_idPathParam, ::OpenAPI::toStringValue(pet_id));
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "DELETE");
|
||||
@ -323,7 +323,7 @@ OAIPetApi::getPetById(const qint64& pet_id) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
QString pet_idPathParam("{");
|
||||
pet_idPathParam.append("petId").append("}");
|
||||
fullPath.replace(pet_idPathParam, ::OpenAPI::toStringValue(pet_id));
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
@ -419,7 +419,7 @@ OAIPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QS
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
QString pet_idPathParam("{");
|
||||
pet_idPathParam.append("petId").append("}");
|
||||
fullPath.replace(pet_idPathParam, ::OpenAPI::toStringValue(pet_id));
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
@ -472,7 +472,7 @@ OAIPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata,
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage");
|
||||
QString pet_idPathParam("{");
|
||||
pet_idPathParam.append("petId").append("}");
|
||||
fullPath.replace(pet_idPathParam, ::OpenAPI::toStringValue(pet_id));
|
||||
fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(pet_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "POST");
|
||||
|
@ -37,7 +37,7 @@ OAIStoreApi::deleteOrder(const QString& order_id) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
|
||||
QString order_idPathParam("{");
|
||||
order_idPathParam.append("orderId").append("}");
|
||||
fullPath.replace(order_idPathParam, ::OpenAPI::toStringValue(order_id));
|
||||
fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "DELETE");
|
||||
@ -138,7 +138,7 @@ OAIStoreApi::getOrderById(const qint64& order_id) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/store/order/{orderId}");
|
||||
QString order_idPathParam("{");
|
||||
order_idPathParam.append("orderId").append("}");
|
||||
fullPath.replace(order_idPathParam, ::OpenAPI::toStringValue(order_id));
|
||||
fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(order_id)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
|
@ -183,7 +183,7 @@ OAIUserApi::deleteUser(const QString& username) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
QString usernamePathParam("{");
|
||||
usernamePathParam.append("username").append("}");
|
||||
fullPath.replace(usernamePathParam, ::OpenAPI::toStringValue(username));
|
||||
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "DELETE");
|
||||
@ -230,7 +230,7 @@ OAIUserApi::getUserByName(const QString& username) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
QString usernamePathParam("{");
|
||||
usernamePathParam.append("username").append("}");
|
||||
fullPath.replace(usernamePathParam, ::OpenAPI::toStringValue(username));
|
||||
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "GET");
|
||||
@ -384,7 +384,7 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& body) {
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
QString usernamePathParam("{");
|
||||
usernamePathParam.append("username").append("}");
|
||||
fullPath.replace(usernamePathParam, ::OpenAPI::toStringValue(username));
|
||||
fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::OpenAPI::toStringValue(username)));
|
||||
|
||||
OAIHttpRequestWorker *worker = new OAIHttpRequestWorker();
|
||||
OAIHttpRequestInput input(fullPath, "PUT");
|
||||
|
Loading…
x
Reference in New Issue
Block a user