swagger

Serve interactive Swagger UI and raw OpenAPI spec from a TypeScript-based definition.

Updated Apr 16, 2025
One-click install
npx skills add https://github.com/teexiii/boilerplate-rest-bun-for-noob --skill swagger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swagger
Source: https://github.com/teexiii/boilerplate-rest-bun-for-noob/tree/main/.agent/skills/swagger
Command: npx skills add https://github.com/teexiii/boilerplate-rest-bun-for-noob --skill swagger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralize API documentation and provide an interactive UI to explore and test endpoints, improving developer onboarding and collaboration.

Core Features & Use Cases

  • Serve Swagger UI at /api/docs for interactive API exploration.
  • Serve the raw OpenAPI spec at /api/docs/swagger.json for machine-readable documentation.
  • Serve static assets from swagger-ui-dist to render the UI consistently across environments.
  • Maintain a TypeScript OpenAPI spec in swagger/spec.ts to define API contracts.

Quick Start

Open the UI at /api/docs to interact with the OpenAPI spec and browse available endpoints.

Frequently Asked Questions about swagger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I serve interactive Swagger UI for an OpenAPI spec in TypeScript?

You serve interactive Swagger UI by routing the TypeScript OpenAPI spec, Swagger UI assets, and static files to the /api/docs endpoint for interactive API exploration and testing.

What is the best way to document API endpoints for external consumers?

The best way to document API endpoints for external consumers is to maintain a TypeScript OpenAPI spec and serve it as raw JSON and interactive Swagger UI, improving developer onboarding and API collaboration.

Does serving Swagger UI require static assets from swagger-ui-dist?

Yes, serving Swagger UI requires static assets from swagger-ui-dist to render the interactive API documentation consistently across environments.

How can I expose a machine-readable OpenAPI spec for my API?

You expose a machine-readable OpenAPI spec by serving the raw JSON specification at a dedicated route like /api/docs/swagger.json for internal and external consumers to fetch programmatically.

Can I define API authentication flows using a TypeScript OpenAPI spec?

Yes, you can define API authentication flows by maintaining a TypeScript OpenAPI specification that publishes endpoints, versions, and authentication flows for internal and external API consumers.

When do I need to serve a raw OpenAPI spec alongside Swagger UI?

You need to serve a raw OpenAPI spec alongside Swagger UI when external consumers require machine-readable documentation for automated integration, complementing the interactive UI with raw JSON at /api/docs/swagger.json.