You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-85Lines changed: 63 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,37 @@
1
1
# OpenAPI Integration with DocC
2
2
3
-
This project provides tools and examples for integrating OpenAPI specifications with Apple's DocC documentation system. It allows developers to create beautiful, interactive documentation for REST APIs that matches the style and quality of Swift API documentation.
3
+
The project aims to bridge the gap between OpenAPI specifications and Swift's DocC documentation framework by developing a tool that automates the generation of DocC documentation from OpenAPI files.
4
4
5
5
## Overview
6
6
7
7
OpenAPI is the industry standard for documenting HTTP services, but Swift developers are already familiar with DocC for their Swift and Objective-C API documentation. This project bridges that gap by converting OpenAPI specifications into a format that DocC can understand and render.
8
8
9
-
## Key Features
10
-
11
-
- Convert OpenAPI 3.x specifications to DocC-compatible format
12
-
- Generate beautiful API documentation
13
-
- Provide a consistent documentation experience for Swift developers
14
-
- Support for documenting endpoints, schemas, parameters, and more
4. **Create a DocC Catalog:** Create a basic documentation catalog directory (e.g., `MyAPI.docc`). This needs at least one markdown file to serve as the root landing page.
echo"# RegistryAPI\\n\\nSwift Package Registry API documentation."> RegistryAPI.docc/RegistryAPI.md
106
-
```
73
+
## Viewing the Documentation
107
74
108
-
5. **Generate Archive:**
75
+
The `docs/` directory in this repository contains the pre-generated DocC documentation website output for the **Swagger Pet Store API**, which was built using the `petstore.symbolgraph.json` generated by this tool and the `API.docc` catalog.
You can view generated `.doccarchive` files in Xcode or host them online.
83
+
### Local Documentation Server
119
84
120
-
### Example Pet Store Documentation (Pre-built)
85
+
You can serve the documentation locally using one of these methods:
121
86
122
-
The `docs/` directory in this repository contains pre-generated DocC website output forthe **Swagger Pet Store API**. This was built using `Examples/petstore.yaml` and an example `API.docc` catalog.
The tool includes a comprehensive test suite (`swift test`) covering parsing, conversion, and command-line arguments, using examples like the Pet Store API and the Swift Package Registry API.
103
+
Check out the `DocsExample` directory for a working example of a REST API documented with DocC. It showcases how endpoints, schemas, and examples appear in the DocC format.
104
+
105
+
## How It Works
106
+
107
+
1. The OpenAPI specification is parsed using `OpenAPIKit`
108
+
2. The specification is converted to a SymbolGraph, which is the format DocC uses for documentation
109
+
3. DocC processes the SymbolGraph and generates the documentation
110
+
4. The documentation can be served as a static website or deployed to GitHub Pages
138
111
139
112
## GitHub Pages Deployment
140
113
141
-
This repository automatically deploys the pre-built Pet Store documentation from the `docs` directory to GitHub Pages via the `.github/workflows/pages.yml` workflow.
114
+
This repository is configured to automatically deploy documentation to GitHub Pages whenever changes are pushed to the main branch. The deployment process:
115
+
116
+
1. Uses the GitHub Actions workflow defined in `.github/workflows/pages.yml`
117
+
2. Takes the contents of the `docs` directory
118
+
3. Deploys them to GitHub Pages
119
+
4. Makes the documentation available at the URL: [https://ayushshrivastv.github.io/OpenAPI-integration-with-DocC/](https://ayushshrivastv.github.io/OpenAPI-integration-with-DocC/)
0 commit comments