Skip to content

Built-in /docs endpoint similar to FastAPI for automatic API documentation #7069

@ayushs206

Description

@ayushs206

Feature Request

It would be extremely helpful if Express provided a built-in /docs endpoint (similar to FastAPI) that automatically generates interactive API documentation.

Motivation

Frameworks like FastAPI provide automatic OpenAPI/Swagger documentation at /docs by default. This significantly improves:

  • Developer experience
  • Faster API testing
  • Quick onboarding for contributors
  • Reduced dependency on external tools like Postman for small APIs

Currently in Express, developers need to manually integrate third-party packages such as:

  • swagger-ui-express
  • swagger-jsdoc
  • Redoc

While these solutions work well, having an optional built-in documentation middleware would make Express even more developer-friendly, especially for small projects, prototypes, and teaching environments.

Proposed Solution

Provide an optional built-in middleware that:

  • Auto-detects registered routes
  • Generates OpenAPI schema automatically
  • Serves interactive documentation at /docs
  • Can be enabled with something like:
app.enableDocs();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions