File tree Expand file tree Collapse file tree 4 files changed +66
-1274
lines changed
Expand file tree Collapse file tree 4 files changed +66
-1274
lines changed Original file line number Diff line number Diff line change 1+ # Prysm Custom API Documentation
2+
3+ This directory contains Swagger 2.0 documentation for Prysm's custom beacon node API endpoints.
4+
5+ ## Files
6+
7+ - ` swagger.json ` - OpenAPI 2.0 specification in JSON format
8+ - ` swagger.yaml ` - OpenAPI 2.0 specification in YAML format
9+
10+ ## Viewing the Documentation
11+
12+ You can view the API documentation using any Swagger UI viewer:
13+
14+ 1 . ** Online Swagger Editor** : Upload ` swagger.json ` to [ editor.swagger.io] ( https://editor.swagger.io/ )
15+ 2 . ** Swagger UI Docker** :
16+ ``` bash
17+ docker run -p 8080:8080 -e SWAGGER_JSON=/docs/swagger.json -v $( pwd) /docs:/docs swaggerapi/swagger-ui
18+ ```
19+ 3 . ** VS Code Extension** : Use the "OpenAPI (Swagger) Editor" extension
20+
21+ ## Regenerating the Documentation
22+
23+ The swagger files are generated from Go annotations in the source code using the [ swag] ( https://github.com/swaggo/swag ) CLI tool.
24+
25+ ### Prerequisites
26+
27+ Install swag CLI:
28+
29+ ``` bash
30+ go install github.com/swaggo/swag/cmd/swag@latest
31+ ```
32+
33+ ### Generate Swagger Files
34+
35+ From the repository root:
36+
37+ ``` bash
38+ swag init -g beacon-chain/rpc/prysm/doc.go -o docs/ --parseDependency --parseInternal
39+ ```
You can’t perform that action at this time.
0 commit comments