From dab92a0546cc250560467b43d69bfb940bb43484 Mon Sep 17 00:00:00 2001 From: Sergei Lebedev Date: Wed, 18 Sep 2024 12:26:54 +0200 Subject: [PATCH 1/3] Implementation of new `makeOperationsVirtual` option --- docs/generators/cpp-qt-client.md | 1 + .../openapitools/codegen/languages/CppQtClientCodegen.java | 5 +++++ .../src/main/resources/cpp-qt-client/api-header.mustache | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index ad64db7463b3..da84bd119d5b 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|makeOperationsVirtual|Make all operations methods virtual. This makes it easy to mock the generated API class for testing purposes.| |false| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| |packageName|C++ package (library) name.| |QtOpenAPIClient| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java index 49fe90d08ad0..234954459048 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @@ -36,11 +36,15 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenConfig { public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate client.pri."; public static final String DEFAULT_PACKAGE_NAME = "QtOpenAPIClient"; + public static final String MAKE_OPERATIONS_VIRTUAL_DESC = + "Make all operations methods virtual. " + + "This makes it easy to mock the generated API class for testing purposes."; protected String packageName = ""; // source folder where to write the files protected String sourceFolder = "client"; @Setter protected boolean optionalProjectFileFlag = true; @Setter protected boolean addDownloadProgress = false; + @Setter protected boolean makeOperationsVirtual = false; public CppQtClientCodegen() { super(); @@ -100,6 +104,7 @@ public CppQtClientCodegen() { addOption(CodegenConstants.PACKAGE_NAME, "C++ package (library) name.", DEFAULT_PACKAGE_NAME); addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, this.optionalProjectFileFlag); addSwitch("addDownloadProgress", "Add support for Qt download progress", this.addDownloadProgress); + addSwitch("makeOperationsVirtual", MAKE_OPERATIONS_VIRTUAL_DESC, this.makeOperationsVirtual); supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, PREFIX + "Helpers.h")); supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder, PREFIX + "Helpers.cpp")); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache index 5391f6a6b057..c23076286fbc 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache @@ -58,7 +58,7 @@ public: {{/required}} {{/allParams}} */{{/hasParams}} - {{#isDeprecated}}Q_DECL_DEPRECATED {{/isDeprecated}}void {{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} &{{/required}}{{^required}}const ::{{cppNamespace}}::OptionalParam<{{{dataType}}}> &{{/required}}{{paramName}}{{^required}} = ::{{cppNamespace}}::OptionalParam<{{{dataType}}}>(){{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#isDeprecated}}Q_DECL_DEPRECATED {{/isDeprecated}}{{#makeOperationsVirtual}}virtual {{/makeOperationsVirtual}}void {{nickname}}({{#allParams}}{{#required}}const {{{dataType}}} &{{/required}}{{^required}}const ::{{cppNamespace}}::OptionalParam<{{{dataType}}}> &{{/required}}{{paramName}}{{^required}} = ::{{cppNamespace}}::OptionalParam<{{{dataType}}}>(){{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}}{{/operations}} private: From 4e0da24b65b65353586a736aa0f127f42801d9f6 Mon Sep 17 00:00:00 2001 From: Sergei Lebedev Date: Mon, 23 Sep 2024 09:24:47 +0200 Subject: [PATCH 2/3] Make new parameter `true` by default --- docs/generators/cpp-qt-client.md | 2 +- .../org/openapitools/codegen/languages/CppQtClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index da84bd119d5b..0cac6f6e4f7d 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -26,7 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| -|makeOperationsVirtual|Make all operations methods virtual. This makes it easy to mock the generated API class for testing purposes.| |false| +|makeOperationsVirtual|Make all operations methods virtual. This makes it easy to mock the generated API class for testing purposes.| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| |packageName|C++ package (library) name.| |QtOpenAPIClient| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java index 234954459048..14b7777af9ad 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @@ -44,7 +44,7 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC protected String sourceFolder = "client"; @Setter protected boolean optionalProjectFileFlag = true; @Setter protected boolean addDownloadProgress = false; - @Setter protected boolean makeOperationsVirtual = false; + @Setter protected boolean makeOperationsVirtual = true; public CppQtClientCodegen() { super(); From 05e7e8ed2ef4714216afeef5d8186520615e9ba0 Mon Sep 17 00:00:00 2001 From: Sergei Lebedev Date: Mon, 23 Sep 2024 14:00:11 +0200 Subject: [PATCH 3/3] Fix default value set and regenerate samples --- .../codegen/languages/CppQtClientCodegen.java | 9 ++++++++- .../client/PFXPetApi.h | 18 +++++++++--------- .../client/PFXPrimitivesApi.h | 4 ++-- .../client/PFXStoreApi.h | 8 ++++---- .../client/PFXUserApi.h | 16 ++++++++-------- .../client/petstore/cpp-qt/client/PFXPetApi.h | 18 +++++++++--------- .../petstore/cpp-qt/client/PFXPrimitivesApi.h | 4 ++-- .../petstore/cpp-qt/client/PFXStoreApi.h | 8 ++++---- .../client/petstore/cpp-qt/client/PFXUserApi.h | 16 ++++++++-------- 9 files changed, 54 insertions(+), 47 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java index 14b7777af9ad..e03d8cfb0fdb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQtClientCodegen.java @@ -36,6 +36,7 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenConfig { public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate client.pri."; public static final String DEFAULT_PACKAGE_NAME = "QtOpenAPIClient"; + public static final String MAKE_OPERATIONS_VIRTUAL_NAME = "makeOperationsVirtual"; public static final String MAKE_OPERATIONS_VIRTUAL_DESC = "Make all operations methods virtual. " + "This makes it easy to mock the generated API class for testing purposes."; @@ -104,7 +105,7 @@ public CppQtClientCodegen() { addOption(CodegenConstants.PACKAGE_NAME, "C++ package (library) name.", DEFAULT_PACKAGE_NAME); addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, this.optionalProjectFileFlag); addSwitch("addDownloadProgress", "Add support for Qt download progress", this.addDownloadProgress); - addSwitch("makeOperationsVirtual", MAKE_OPERATIONS_VIRTUAL_DESC, this.makeOperationsVirtual); + addSwitch(MAKE_OPERATIONS_VIRTUAL_NAME, MAKE_OPERATIONS_VIRTUAL_DESC, this.makeOperationsVirtual); supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, PREFIX + "Helpers.h")); supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder, PREFIX + "Helpers.cpp")); @@ -145,6 +146,12 @@ public void processOpts() { additionalProperties.put(CodegenConstants.OPTIONAL_PROJECT_FILE, optionalProjectFileFlag); } + if (additionalProperties.containsKey(MAKE_OPERATIONS_VIRTUAL_NAME)) { + setMakeOperationsVirtual(convertPropertyToBooleanAndWriteBack(MAKE_OPERATIONS_VIRTUAL_NAME)); + } else { + additionalProperties.put(MAKE_OPERATIONS_VIRTUAL_NAME, makeOperationsVirtual); + } + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); if (additionalProperties.containsKey("modelNamePrefix")) { diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.h b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.h index e2688c5b9d30..5d69d20d8726 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.h @@ -62,50 +62,50 @@ class PFXPetApi : public QObject { /** * @param[in] pfx_pet PFXPet [required] */ - void addPet(const PFXPet &pfx_pet); + virtual void addPet(const PFXPet &pfx_pet); - void allPets(); + virtual void allPets(); /** * @param[in] pet_id qint64 [required] * @param[in] api_key QString [optional] */ - void deletePet(const qint64 &pet_id, const ::test_namespace::OptionalParam &api_key = ::test_namespace::OptionalParam()); + virtual void deletePet(const qint64 &pet_id, const ::test_namespace::OptionalParam &api_key = ::test_namespace::OptionalParam()); /** * @param[in] status QList [required] */ - void findPetsByStatus(const QList &status); + virtual void findPetsByStatus(const QList &status); /** * @param[in] tags QList [required] */ - Q_DECL_DEPRECATED void findPetsByTags(const QList &tags); + Q_DECL_DEPRECATED virtual void findPetsByTags(const QList &tags); /** * @param[in] pet_id qint64 [required] */ - void getPetById(const qint64 &pet_id); + virtual void getPetById(const qint64 &pet_id); /** * @param[in] pfx_pet PFXPet [required] */ - void updatePet(const PFXPet &pfx_pet); + virtual void updatePet(const PFXPet &pfx_pet); /** * @param[in] pet_id qint64 [required] * @param[in] name QString [optional] * @param[in] status QString [optional] */ - void updatePetWithForm(const qint64 &pet_id, const ::test_namespace::OptionalParam &name = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &status = ::test_namespace::OptionalParam()); + virtual void updatePetWithForm(const qint64 &pet_id, const ::test_namespace::OptionalParam &name = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &status = ::test_namespace::OptionalParam()); /** * @param[in] pet_id qint64 [required] * @param[in] additional_metadata QString [optional] * @param[in] file PFXHttpFileElement [optional] */ - void uploadFile(const qint64 &pet_id, const ::test_namespace::OptionalParam &additional_metadata = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &file = ::test_namespace::OptionalParam()); + virtual void uploadFile(const qint64 &pet_id, const ::test_namespace::OptionalParam &additional_metadata = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &file = ::test_namespace::OptionalParam()); private: diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.h b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.h index 722ef1746b55..f3a447e2d94c 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.h +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.h @@ -58,12 +58,12 @@ class PFXPrimitivesApi : public QObject { /** * @param[in] body qint32 [optional] */ - void primitivesIntegerPost(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); + virtual void primitivesIntegerPost(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); /** * @param[in] body double [optional] */ - void primitivesNumberPut(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); + virtual void primitivesNumberPut(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); private: diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.h index e5ff6fd32b7a..a9998a0e55c6 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.h @@ -60,20 +60,20 @@ class PFXStoreApi : public QObject { /** * @param[in] order_id QString [required] */ - void deleteOrder(const QString &order_id); + virtual void deleteOrder(const QString &order_id); - void getInventory(); + virtual void getInventory(); /** * @param[in] order_id qint64 [required] */ - void getOrderById(const qint64 &order_id); + virtual void getOrderById(const qint64 &order_id); /** * @param[in] pfx_order PFXOrder [required] */ - void placeOrder(const PFXOrder &pfx_order); + virtual void placeOrder(const PFXOrder &pfx_order); private: diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.h b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.h index 8356df7c53e0..39821909a15c 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.h @@ -59,42 +59,42 @@ class PFXUserApi : public QObject { /** * @param[in] pfx_user PFXUser [required] */ - void createUser(const PFXUser &pfx_user); + virtual void createUser(const PFXUser &pfx_user); /** * @param[in] pfx_user QList [required] */ - void createUsersWithArrayInput(const QList &pfx_user); + virtual void createUsersWithArrayInput(const QList &pfx_user); /** * @param[in] pfx_user QList [required] */ - void createUsersWithListInput(const QList &pfx_user); + virtual void createUsersWithListInput(const QList &pfx_user); /** * @param[in] username QString [required] */ - void deleteUser(const QString &username); + virtual void deleteUser(const QString &username); /** * @param[in] username QString [required] */ - void getUserByName(const QString &username); + virtual void getUserByName(const QString &username); /** * @param[in] username QString [required] * @param[in] password QString [required] */ - void loginUser(const QString &username, const QString &password); + virtual void loginUser(const QString &username, const QString &password); - void logoutUser(); + virtual void logoutUser(); /** * @param[in] username QString [required] * @param[in] pfx_user PFXUser [required] */ - void updateUser(const QString &username, const PFXUser &pfx_user); + virtual void updateUser(const QString &username, const PFXUser &pfx_user); private: diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.h b/samples/client/petstore/cpp-qt/client/PFXPetApi.h index 42d40f1735fd..4e86ad47e1fa 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.h @@ -62,50 +62,50 @@ class PFXPetApi : public QObject { /** * @param[in] pfx_pet PFXPet [required] */ - void addPet(const PFXPet &pfx_pet); + virtual void addPet(const PFXPet &pfx_pet); - void allPets(); + virtual void allPets(); /** * @param[in] pet_id qint64 [required] * @param[in] api_key QString [optional] */ - void deletePet(const qint64 &pet_id, const ::test_namespace::OptionalParam &api_key = ::test_namespace::OptionalParam()); + virtual void deletePet(const qint64 &pet_id, const ::test_namespace::OptionalParam &api_key = ::test_namespace::OptionalParam()); /** * @param[in] status QList [required] */ - void findPetsByStatus(const QList &status); + virtual void findPetsByStatus(const QList &status); /** * @param[in] tags QList [required] */ - Q_DECL_DEPRECATED void findPetsByTags(const QList &tags); + Q_DECL_DEPRECATED virtual void findPetsByTags(const QList &tags); /** * @param[in] pet_id qint64 [required] */ - void getPetById(const qint64 &pet_id); + virtual void getPetById(const qint64 &pet_id); /** * @param[in] pfx_pet PFXPet [required] */ - void updatePet(const PFXPet &pfx_pet); + virtual void updatePet(const PFXPet &pfx_pet); /** * @param[in] pet_id qint64 [required] * @param[in] name QString [optional] * @param[in] status QString [optional] */ - void updatePetWithForm(const qint64 &pet_id, const ::test_namespace::OptionalParam &name = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &status = ::test_namespace::OptionalParam()); + virtual void updatePetWithForm(const qint64 &pet_id, const ::test_namespace::OptionalParam &name = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &status = ::test_namespace::OptionalParam()); /** * @param[in] pet_id qint64 [required] * @param[in] additional_metadata QString [optional] * @param[in] file PFXHttpFileElement [optional] */ - void uploadFile(const qint64 &pet_id, const ::test_namespace::OptionalParam &additional_metadata = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &file = ::test_namespace::OptionalParam()); + virtual void uploadFile(const qint64 &pet_id, const ::test_namespace::OptionalParam &additional_metadata = ::test_namespace::OptionalParam(), const ::test_namespace::OptionalParam &file = ::test_namespace::OptionalParam()); private: diff --git a/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.h b/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.h index 64de9e41430b..00851c1f27ef 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.h @@ -58,12 +58,12 @@ class PFXPrimitivesApi : public QObject { /** * @param[in] body qint32 [optional] */ - void primitivesIntegerPost(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); + virtual void primitivesIntegerPost(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); /** * @param[in] body double [optional] */ - void primitivesNumberPut(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); + virtual void primitivesNumberPut(const ::test_namespace::OptionalParam &body = ::test_namespace::OptionalParam()); private: diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt/client/PFXStoreApi.h index 0966e3f00d6c..d401bdfa337c 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.h @@ -60,20 +60,20 @@ class PFXStoreApi : public QObject { /** * @param[in] order_id QString [required] */ - void deleteOrder(const QString &order_id); + virtual void deleteOrder(const QString &order_id); - void getInventory(); + virtual void getInventory(); /** * @param[in] order_id qint64 [required] */ - void getOrderById(const qint64 &order_id); + virtual void getOrderById(const qint64 &order_id); /** * @param[in] pfx_order PFXOrder [required] */ - void placeOrder(const PFXOrder &pfx_order); + virtual void placeOrder(const PFXOrder &pfx_order); private: diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.h b/samples/client/petstore/cpp-qt/client/PFXUserApi.h index 29bfe7159715..3344f95783ac 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.h @@ -59,42 +59,42 @@ class PFXUserApi : public QObject { /** * @param[in] pfx_user PFXUser [required] */ - void createUser(const PFXUser &pfx_user); + virtual void createUser(const PFXUser &pfx_user); /** * @param[in] pfx_user QList [required] */ - void createUsersWithArrayInput(const QList &pfx_user); + virtual void createUsersWithArrayInput(const QList &pfx_user); /** * @param[in] pfx_user QList [required] */ - void createUsersWithListInput(const QList &pfx_user); + virtual void createUsersWithListInput(const QList &pfx_user); /** * @param[in] username QString [required] */ - void deleteUser(const QString &username); + virtual void deleteUser(const QString &username); /** * @param[in] username QString [required] */ - void getUserByName(const QString &username); + virtual void getUserByName(const QString &username); /** * @param[in] username QString [required] * @param[in] password QString [required] */ - void loginUser(const QString &username, const QString &password); + virtual void loginUser(const QString &username, const QString &password); - void logoutUser(); + virtual void logoutUser(); /** * @param[in] username QString [required] * @param[in] pfx_user PFXUser [required] */ - void updateUser(const QString &username, const PFXUser &pfx_user); + virtual void updateUser(const QString &username, const PFXUser &pfx_user); private: