Update NodeJS server petstore samples with OAS2, OAS3 (#113)

* update nodejs server oas2

* update nodejs server petstore with oas3

* update nodejs google cloud with oas2 petstore

* update nodejs server google function with oas3
This commit is contained in:
William Cheng
2018-04-17 22:58:13 +08:00
committed by GitHub
parent dc0cbd23b6
commit ddf10b98dc
19 changed files with 1698 additions and 153 deletions

View File

@@ -391,7 +391,8 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
if (operation.getOperationId() == null) {
operation.setOperationId(getOrGenerateOperationId(operation, pathname, method.toString()));
}
if (operation.getExtensions().get("x-openapi-router-controller") == null) {
if (operation.getExtensions() == null ||
operation.getExtensions().get("x-openapi-router-controller") == null) {
operation.addExtension("x-openapi-router-controller", sanitizeTag(tag));
}
}