mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Add AsyncAPI spec for websocket (#613)
* AsyncAPI for websocket docs * Delete old docs * Update docs/README.md to point to docs site * Add generated API docs
This commit is contained in:
parent
fce43ae035
commit
8a17375603
110 changed files with 8325 additions and 23324 deletions
38
specs/build-docs.sh
Executable file
38
specs/build-docs.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Build documentation from OpenAPI and AsyncAPI specifications
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
echo "Building TrustGraph API Documentation..."
|
||||
echo
|
||||
|
||||
# Create output directory
|
||||
mkdir -p ../docs
|
||||
|
||||
# Build REST API documentation
|
||||
echo "Building REST API documentation (OpenAPI)..."
|
||||
cd api
|
||||
npx --yes @redocly/cli build-docs openapi.yaml -o ../../docs/api.html
|
||||
echo "✓ REST API docs generated: docs/api.html"
|
||||
echo
|
||||
|
||||
# Build WebSocket API documentation
|
||||
echo "Building WebSocket API documentation (AsyncAPI)..."
|
||||
cd ../websocket
|
||||
npx --yes -p @asyncapi/cli asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template@3.0.0 --use-new-generator -o /tmp/asyncapi-build -p singleFile=true --force-write
|
||||
mv /tmp/asyncapi-build/index.html ../../docs/websocket.html
|
||||
rm -rf /tmp/asyncapi-build
|
||||
echo "✓ WebSocket API docs generated: docs/websocket.html"
|
||||
echo
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
echo "Documentation build complete!"
|
||||
echo
|
||||
echo "View documentation:"
|
||||
echo " REST API: file://$(realpath ../docs/api.html)"
|
||||
echo " WebSocket API: file://$(realpath ../docs/websocket.html)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue