-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[cpp-restsdk] Generate mockable APIs #595
[cpp-restsdk] Generate mockable APIs #595
Conversation
@@ -22,11 +22,24 @@ namespace {{this}} { | |||
|
|||
using namespace {{modelNamespace}}; | |||
|
|||
class {{declspec}} {{classname}} | |||
class {{declspec}} I{{classname}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part should be encapsulated with the new mustache variable, so that current users are not impacted
{ | ||
public: | ||
{{classname}}( std::shared_ptr<ApiClient> apiClient ); | ||
virtual ~{{classname}}(); | ||
~{{classname}}() override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
@@ -41,7 +54,7 @@ public: | |||
{{#allParams}} | |||
{{^required}}boost::optional<{{/required}}{{#isFile}}std::shared_ptr<{{/isFile}}{{{dataType}}}{{#isFile}}>{{/isFile}}{{^required}}>{{/required}} {{paramName}}{{#hasMore}},{{/hasMore}} | |||
{{/allParams}} | |||
); | |||
) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
@etherealjoy Addressed all your comments! |
@Peaches491 thanks for the PR, which has been merged into master @etherealjoy thanks for reviewing the change. |
* Port GMock feature from NativeInstruments swagger-codegen fork: NativeInstruments/swagger-codegen#9 * Update petstore for Mockable APIs * Fix shared_ptr in templates for File params * Add guards in templates for GMock APIs * Regenerate samples without GMocks * Add useful constructors for GMock APIs * Add constructors to API header interface * Update samples with explicit monadic constructors * Add default implementations for destructors
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.1.x
,4.0.x
. Default:master
.Description of the PR
Port of NativeInstruments/swagger-codegen#9 to
openapi-generator
project.Description of the original PR