Auto-Documentation

Beta Feature

This feature is currently in Beta.

Newgate can automatically generate OpenAPI (Swagger) specifications from your registered routes.

How it works

When enabled, Newgate inspects your route registry and generates a standard openapi.json file.

// Example usage (Coming Soon)
app.enableDocs({
    path: '/api-docs',
    title: 'My API',
    version: '1.0.0'
});

The documentation generator infers:

  • Paths: From your route definitions (/users/:id).
  • Methods: GET, POST, etc.
  • Parameters: From :param segments.

For request/response body schemas, you will be able to opt-in using a schema validation library in future versions.

Last updated: 12/11/2025 Edit on GitHub