REST API Documentation with DocC

This project showcases how OpenAPI specifications can be transformed into beautiful, interactive documentation using Swift's Documentation Compiler (DocC).

The docs folder contains the HTML files generated by DocC using the command:

docc convert symbolgraph.json --output-path docs

This conversion process maps OpenAPI components to SymbolKit symbol kinds:

Example Endpoints

The documentation includes complete details about request parameters, response models, and examples for endpoints such as:

  • GET /users - Retrieve all users
  • GET /users/{id} - Get a specific user by ID
  • POST /users - Create a new user
  • PUT /users/{id} - Update an existing user

Exploring the Documentation

The DocC documentation provides several ways to explore the API:

Technical Implementation

The conversion process from OpenAPI to DocC involves:

  1. Parsing the OpenAPI specification
  2. Generating SymbolGraph JSON
  3. Converting the SymbolGraph to DocC documentation
  4. Rendering the documentation as HTML
View the API Documentation

Benefits of DocC Documentation

Using DocC for API documentation offers several advantages: