Skip to content
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

Add a new NodeJS Express server generator #3567

Merged
merged 45 commits into from
Aug 8, 2019
Merged

Conversation

wing328
Copy link
Member

@wing328 wing328 commented Aug 6, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{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\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

wing328 and others added 30 commits May 7, 2019 16:14
…pi-generator into nodejs-express-server

# Conflicts:
#	samples/server/petstore/nodejs-express-server/.eslintrc
#	samples/server/petstore/nodejs-express-server/config.js
#	samples/server/petstore/nodejs-express-server/expressServer.js
#	samples/server/petstore/nodejs-express-server/index.js
#	samples/server/petstore/nodejs-express-server/package.json
#	samples/server/petstore/nodejs-express-server/tests/serverTests.js
… and validation, and an internal router to pass arguments to controllers and services. /controllers/Pet.js and /services/PetService.js should be used for reverse engineering for future codegen script
…s to swager); some work on handling file uploads; some work on tests
…into nodejs-express-server

# Conflicts:
#	samples/server/petstore/nodejs-express-server/controllers/index.js
* update generator and template

* update samples

* more update

* update service, controller

* add vendor extensions

* update doc
Each path operation has a 'x-openapi-router-controller' and 'x-openapi-router-service'. Automated files will be placed under /controllers and /services respectively.
Controller file names will end with 'Controller.js'.
Removed swaggerRouter, replaced it with openapiRouter
Routing works and simple tests show a return of 200 to requests.
Merge remote-tracking branch 'upstream/nodejs-express-server' into nodejs-express-server

# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java
#	samples/server/petstore/nodejs-express-server/controllers/StoreController.js
#	samples/server/petstore/nodejs-express-server/controllers/TestController.js
#	samples/server/petstore/nodejs-express-server/controllers/UserController.js
#	samples/server/petstore/nodejs-express-server/service/PetService.js
#	samples/server/petstore/nodejs-express-server/service/StoreService.js
#	samples/server/petstore/nodejs-express-server/service/UserService.js
wing328 and others added 12 commits July 13, 2019 00:00
* various fix

* remove dot from service

* add space

* better method empty argument
…aml and tries calling them, expecting 200 in return. Currently not all tests pass - not supporting xml, and problems with formData

2. Removed old testing files.
3. Added model files - contain data and structure as defined in openapi.yaml. Model.js has static methods relevant to all model files.
4. Changed openapi.yaml to allow running tests easily.
…aml and tries calling them, expecting 200 in return. Currently not all tests pass - not supporting xml, and problems with formData (#3442)

2. Removed old testing files.
3. Added model files - contain data and structure as defined in openapi.yaml. Model.js has static methods relevant to all model files.
4. Changed openapi.yaml to allow running tests easily.
Removed test files that are not needed.
Removed utils/writer.js which is not needed, and the references to it in the codegen files
…t. index.js now calls ExpressServer.js directly. Updated files that used to call app.js. Updated README.md accordingly

Added a path to call the openapi.yaml, and a test file for all endpoints that are not in the openapi.yaml, ensuring that they return 200. Updated README.md accordingly
@auto-labeler auto-labeler bot added the WIP Work in Progress label Aug 6, 2019
@auto-labeler
Copy link

auto-labeler bot commented Aug 6, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

* remove test controller

* add back changes to templates

* remove app.js
@wing328 wing328 changed the title [WIP] Nodejs express server Add a new NodeJS Express server generator Aug 8, 2019
@wing328 wing328 removed the WIP Work in Progress label Aug 8, 2019
@wing328 wing328 merged commit 2d7cc77 into master Aug 8, 2019
@wing328 wing328 deleted the nodejs-express-server branch August 8, 2019 16:30
jimschubert added a commit that referenced this pull request Aug 11, 2019
* master: (122 commits)
  Fix #3604 by adding undefined as return type to headers and credentials methods in runtime.ts (#3605)
  Prepare 4.1.1-SNAPSHOT (#3603)
  Prepare 4.1.0 release (#3597)
  [java][client][jax-rs] Add a constant for Jackson @JsonProperty (#3560)
  restore openapi3 petstore.yaml (#3590)
  Add a new NodeJS Express server generator (#3567)
  [C#][client][csharp-netcore] Fix csharp netcore defaultheaders (#3562)
  Fix issue deserializing to nullptr (#3572)
  [OCaml] Add file post-processing (#3583)
  [dart2] Fix up test code generation, double deserialization, 'new' keyword deprecation (#3576)
  Run Qt5 client sample test (#3415)
  typescript-fetch: allow configuration of headers and credentials (#3586)
  using partials in ruby api_client (#3564)
  [OCaml] Added optional params support in API operations (#3568)
  [Rust Server] Generate valid Rustdocs for lazy_static items (#3556)
  Fix NPM build for Typescript-fetch (#3403)
  Expand path templates via resttemplate's uriTemplateHandler (#3500)
  Readme updated with a new tutorial and company using OpenAPI Generator (#3566)
  Fix logic of `getNullableType` of csharp server and client. (#3537)
  [Ruby] clean up Ruby dev dependencies (#3551)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants