Skip to content

Commit 1fbeb56

Browse files
docs: add openapi specifications for device management (#686)
1 parent 2f93205 commit 1fbeb56

22 files changed

+732
-3900
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ vendor/
3131
# ...ignore the ui folder
3232
**/ui/*
3333
# ...but keep the folder
34-
!**/ui/.gitkeep
34+
!**/ui/.gitkeep
35+
# Documentation files
36+
doc/openapi.json

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ Before contributing code changes, familiarize yourself with:
160160
- [Console Architecture Overview](https://github.com/device-management-toolkit/console/wiki/Architecture-Overview)
161161
- [Console Data Storage Documentation](https://github.com/device-management-toolkit/console/wiki/Console-Data-Storage)
162162

163+
### OpenAPI Documentation
164+
165+
Console automatically generates OpenAPI documentation when running in debug mode:
166+
167+
1. **Enable Debug Mode**: Set `GIN_MODE=debug` in your `.env` file
168+
2. **Run Console**: Start the application with `go run ./cmd/app/main.go`
169+
3. **Access OpenAPI Spec**: The OpenAPI specification is automatically generated and available at:
170+
- JSON format: `http://localhost:8181/openapi.json`
171+
- The spec is also written to `doc/openapi.json` in your project directory
172+
4. **To add API Documentation**: Check wiki `https://github.com/device-management-toolkit/console/wiki/API-Documentation-to-Console`
173+
174+
> **Note**: OpenAPI generation only occurs in debug mode. Production builds will not expose these endpoints.
175+
163176
## Dev tips for passing CI Checks
164177

165178
- Install gofumpt `go install mvdan.cc/gofumpt@latest` (replaces gofmt)

0 commit comments

Comments
 (0)