forked from loafle/openapi-generator-original
added more instructions, service template
This commit is contained in:
parent
531e2d7032
commit
ae1d43dc84
@ -43,7 +43,9 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
* @return A string value for the help message
|
* @return A string value for the help message
|
||||||
*/
|
*/
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a nodejs server library.";
|
return "Generates a nodejs server library using the swagger-tools project. By default, " +
|
||||||
|
"it will not generate service classes--which you will have to implement on your own or let " +
|
||||||
|
"the codegen do it with the `-Dservice` environment variable.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NodeJSServerCodegen() {
|
public NodeJSServerCodegen() {
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
{{#operations}}
|
||||||
|
{{#operation}}
|
||||||
|
exports.{{nickname}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
|
||||||
|
|
||||||
|
var examples = {};
|
||||||
|
{{#examples}}
|
||||||
|
examples['{{contentType}}'] = {{{example}}};
|
||||||
|
{{/examples}}
|
||||||
|
|
||||||
|
{{#returnType}}
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
|
return examples[Object.keys(examples)[0]];
|
||||||
|
{{/returnType}}
|
||||||
|
}
|
||||||
|
{{/operation}}
|
||||||
|
{{/operations}}
|
Loading…
x
Reference in New Issue
Block a user