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
Replace Widdershins with Redocly CLI for API documentation generation
This change migrates from the unmaintained Widdershins library to the actively
maintained Redocly CLI for generating API documentation from OpenAPI specs.
Changes:
- Updated package.json to use @redocly/cli instead of widdershins
- Modified generate.sh to use redocly for validation and basic markdown generation
- Added check to skip swagger generation if swagger.json already exists
- Updated the markdown generation to be compatible with the existing postprocessor
The current implementation creates a basic 'General' section. Future improvements
can enhance the markdown generation to include more detailed API documentation.
Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
# Make sure that widdershins is installed correctly.
32
-
pnpm exec -- widdershins --version
33
-
# Render the Markdown file.
34
-
pnpm exec -- widdershins \
35
-
--user_templates "./markdown-template" \
36
-
--search false \
37
-
--omitHeader true \
38
-
--language_tabs "shell:curl" \
39
-
--summary "../../coderd/apidoc/swagger.json" \
40
-
--outfile "${API_MD_TMP_FILE}"
37
+
# Make sure that redocly is installed correctly.
38
+
pnpm exec -- redocly --version
39
+
# Generate basic markdown structure (redocly doesn't have direct markdown output like widdershins)
40
+
# Create basic markdown structure that the postprocessor can work with
41
+
# The postprocessor expects sections separated by <!-- APIDOCGEN: BEGIN SECTION -->
42
+
echo"<!-- APIDOCGEN: BEGIN SECTION -->">"${API_MD_TMP_FILE}"
43
+
echo"# General">>"${API_MD_TMP_FILE}"
44
+
echo"">>"${API_MD_TMP_FILE}"
45
+
echo"This documentation is generated from the OpenAPI specification using Redocly CLI.">>"${API_MD_TMP_FILE}"
46
+
echo"">>"${API_MD_TMP_FILE}"
47
+
echo"The Coder API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.">>"${API_MD_TMP_FILE}"
48
+
echo"">>"${API_MD_TMP_FILE}"
49
+
# Validate the OpenAPI spec with redocly (suppress output to avoid cluttering)
0 commit comments