Skip to content

[BUG][NODEJS] nodejs-express-server API docs path mapping inconsistencies #6976

@kmturley

Description

@kmturley
Description

Swagger and OpenAPI usually expose API documentation at:
/api-docs

Then approach is mirrored across your generators:
https://github.com/OpenAPITools/openapi-generator/search?q=api-docs&unscoped_q=api-docs

However nodejs-express-server uses /api-doc
this.app.use('/api-doc', swaggerUI.serve, swaggerUI.setup(this.schema));
https://github.com/OpenAPITools/openapi-generator/search?q=api-doc&unscoped_q=api-doc

Which is confusing because in the README.md it says /api-docs

  1. API documentation, and to check the available endpoints:
    http://localhost:3000/api-docs/
openapi-generator version

"@openapitools/openapi-generator-cli": "^1.0.15-4.3.1"

OpenAPI declaration file content or url

https://petstore.swagger.io/v2/swagger.yaml

Command line used for generation

npx @openapitools/openapi-generator-cli generate -i ./petstore.yaml -g nodejs-express-server -o ./src

Steps to reproduce
npm install @openapitools/openapi-generator-cli --save-dev
npx @openapitools/openapi-generator-cli list
npx @openapitools/openapi-generator-cli generate -i ./petstore.yaml -g nodejs-express-server -o ./src
cd src
npm install
npm start
Related issues/PRs

none

Suggest a fix

Update strings from /api-doc to /api-docs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions