salvo-openapi

Generate OpenAPI 3.0 documentation from Salvo handlers and routers.

20|5|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/salvo-rs/salvo-skills --skill salvo-openapi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-openapi
Source: https://github.com/salvo-rs/salvo-skills/tree/main/skills/salvo-openapi
Command: npx skills add https://github.com/salvo-rs/salvo-skills --skill salvo-openapi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate OpenAPI 3.0 documentation automatically from Salvo applications to streamline API discovery, client generation, and interactive exploration with Swagger UI.

Core Features & Use Cases

  • Auto-generate OpenAPI documentation from Salvo routers and handlers to keep API docs in sync with code
  • Expose OpenAPI JSON endpoints and integrate Swagger UI for interactive API exploration
  • Leverage standard Salvo extractors (PathParam, QueryParam, JsonBody) to document parameters and schemas automatically
  • Use in real-world workflows to produce client libraries and ensure consistent API contracts across teams

Quick Start

Annotate endpoints with #[endpoint] extractors and merge the OpenAPI router to expose docs at /api-doc/openapi.json

Frequently Asked Questions about salvo-openapi

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

FAQPage Schema
How do I auto-generate OpenAPI documentation from Salvo handlers?

To auto-generate OpenAPI documentation from Salvo handlers, annotate endpoints with extractors like PathParam, QueryParam, and JsonBody, then merge routers into an OpenAPI document using OpenApi::new(...).merge_router(...). This keeps API docs synchronized with your Rust codebase.

How do I add Swagger UI to a Rust Salvo web application?

You can add Swagger UI to a Rust Salvo web application by using this Skill to expose an OpenAPI JSON endpoint. It automatically generates the OpenAPI 3.0 specification from your Salvo routers, enabling interactive API exploration directly from your application.

Do I need specific extractors to document API parameters in Salvo?

Yes, you need standard Salvo endpoint extractors such as PathParam, QueryParam, and JsonBody to document API parameters automatically. These extractors capture the necessary schema and parameter details to build the OpenAPI documentation from your Rust handlers.

How does OpenAPI documentation streamline API client generation in Rust?

OpenAPI documentation streamlines API client generation by producing a standardized OpenAPI 3.0 JSON contract from your Salvo app. Teams use this exposed specification to generate client libraries automatically, ensuring consistent API contracts across different services.

How do I expose OpenAPI JSON at a specific endpoint in a Salvo app?

You expose OpenAPI JSON in a Salvo app by merging your annotated routers into an OpenApi document and routing it to a specific path like /api-doc/openapi.json. This provides standardized API documentation for discovery and client generation.