Skip to content

Commit a1b9a1b

Browse files
authored
Add upstream API types (#78)
This change adds upstream types imported directly from `github.com/modelcontextprotocol/registry`. Handlers return empty bodies. This work is part of #38.
1 parent f6cad56 commit a1b9a1b

File tree

11 files changed

+723
-70
lines changed

11 files changed

+723
-70
lines changed

.github/workflows/verify-docgen.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
15+
- name: Install Task
16+
uses: arduino/setup-task@v2
17+
with:
18+
version: 3.44.1
19+
repo-token: ${{ secrets.GITHUB_TOKEN }}
1520
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
1621
with:
1722
go-version-file: go.mod
1823
- name: Install swag
19-
run: go install github.com/swaggo/swag/v2/cmd/swag@latest
24+
run: task install-swagger
2025
- run: ./cmd/help/verify.sh

.swaggo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// replace internal/api/v0.EnvVarDetail EnvVarDetail
2+
// replace internal/api/v0.ErrorResponse ErrorResponse
3+
// replace internal/api/v0.ListServersResponse ListServersResponse
4+
// replace internal/api/v0.RegistryInfoResponse RegistryInfoResponse
5+
// replace internal/api/v0.ServerDetailResponse ServerDetailResponse
6+
// replace internal/api/v0.ServerSummaryResponse ServerSummaryResponse

Taskfile.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
version: '3'
22

3-
# includes:
4-
# registry-api:
5-
# taskfile: ./cmd/thv-registry-api/Taskfile.yml
6-
# flatten: true
7-
83
tasks:
94
docs:
105
desc: Regenerate the registry API documentation
6+
vars:
7+
SWAG_OUTPUT_DIR: '{{.SWAG_OUTPUT_DIR | default "docs/thv-registry-api"}}'
118
cmds:
129
- rm -rf docs/cli/*
1310
- go run cmd/help/main.go --dir docs/cli
14-
- swag init -g cmd/thv-registry-api/docs.go --v3.1 -o docs/thv-registry-api
11+
# NOTE: check out .swaggo file in the root of the project
12+
# NOTE: We suppress the output to avoid "go/build" messages, it might
13+
# drop messages we care about.
14+
- |
15+
swag init -q -g cmd/thv-registry-api/docs.go \
16+
--v3.1 --output {{.SWAG_OUTPUT_DIR}} \
17+
--parseDependencyLevel 1 2>/dev/null
1518
1619
install-swagger:
1720
desc: Install the swag tool for OpenAPI/Swagger generation

cmd/help/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ diff -Naur -I "^ date:" "$tmpdir" docs/cli/
99
# Generate API docs in temp directory that mimics the final structure
1010
api_tmpdir=$(mktemp -d)
1111
mkdir -p "$api_tmpdir/docs/thv-registry-api"
12-
swag init -g cmd/thv-registry-api/docs.go --v3.1 -o "$api_tmpdir/docs/thv-registry-api"
12+
task docs SWAG_OUTPUT_DIR="$api_tmpdir/docs/thv-registry-api"
1313
# Exclude README.md from diff as it's manually maintained
1414
diff -Naur --exclude="README.md" "$api_tmpdir/docs/thv-registry-api" docs/thv-registry-api/
1515

docs/thv-registry-api/docs.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/thv-registry-api/swagger.json

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)