-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cpp-pistache] removed model namespace when unused for operations #775
[cpp-pistache] removed model namespace when unused for operations #775
Conversation
@@ -250,7 +250,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation | |||
if(importMapping.containsKey(hdr)) { | |||
continue; | |||
} | |||
additionalProperties.put("hasModelImport", true); | |||
operations.put("hasModelImport", true); |
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.
wouldnt it better to put this in the vendor extensions?
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.
We may consider adding this to the top level so that all generators can also use hasModelImport
(I've seen another related request before)
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.
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.
@etherealjoy please go with vendor extension for the time being (e.g. x-codegen-pistache-hasModelImport)
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.
This reverts commit 13f0a8b.
@wing328 @stkrwork private Map<String, Object> processOperations(CodegenConfig config, String tag, \
List<CodegenOperation> ops, List<Object> allModels) is a if (imports.size() > 0) {
operations.put("hasImport", true);
} So I think it makes sense to add |
@etherealjoy thanks for the detailed explanation. I'm ok with your suggested change. We'll consider adding this to the default codegen later. |
…ons level instead of operation/vendorExtensions level.
…enAPITools#775) * Remove using model namespace when model is unused * Add comments to clarify introduction of hasModelImport at API/operations level instead of operation/vendorExtensions level.
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
,4.0.x
. Default:master
.Description of the PR
When there is no import of any model header remove the usage of model namespace as well for each model.
No impact to samples after generation.
Fixes #637 fully.
@ravinikam @MartinDelille @stkrwork @fvarose