Compare commits
2
Commits
ee1f9f3b32
...
eb32d367c8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb32d367c8 | ||
|
|
a134f8443a |
@@ -130,13 +130,13 @@ jobs:
|
||||
run: |
|
||||
go install github.com/swaggo/swag/v2/cmd/swag@v2.0.0-rc5
|
||||
cd server
|
||||
# swag reads Go source, not the import graph, so it needs the
|
||||
# shared module's files on disk. They are in the module cache
|
||||
# now rather than at ../shared, and the cache is read-only,
|
||||
# which swag does not mind.
|
||||
go mod download gitea.hostxtra.co.uk/vantage/vantage-shared
|
||||
SHARED_DIR="$(go list -m -f '{{.Dir}}' gitea.hostxtra.co.uk/vantage/vantage-shared)"
|
||||
swag init --generalInfo cmd/main.go --dir "./,$SHARED_DIR" \
|
||||
--output internal/api/docs --outputTypes json --v3.1
|
||||
if [ -z "$SHARED_DIR" ] || [ ! -d "$SHARED_DIR" ]; then
|
||||
echo "vantage-shared source not in the module cache: '$SHARED_DIR'" >&2
|
||||
exit 1
|
||||
fi
|
||||
swag init --generalInfo cmd/main.go --dir "./,$SHARED_DIR" --output internal/api/docs --outputTypes json --v3.1
|
||||
mv -f internal/api/docs/swagger.json internal/api/docs/openapi.json
|
||||
git diff --exit-code internal/api/docs/openapi.json
|
||||
|
||||
|
||||
Reference in New Issue
Block a user