Skip to content

Commit 01453e3

Browse files
feat: Extract nested properties in their own structs (#158)
1 parent 2bf2288 commit 01453e3

File tree

5 files changed

+7907
-9229
lines changed

5 files changed

+7907
-9229
lines changed

.github/workflows/gen-client.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ jobs:
1616
run: |
1717
curl -H "Authorization: token ${{ secrets.GH_CQ_BOT }}" https://raw.githubusercontent.com/cloudquery/cloud/main/internal/servergen/spec.json -o spec.json
1818
19+
- name: Format Specs File
20+
run: |
21+
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli:v7.5.0 generate -i /local/spec.json -g openapi --skip-validate-spec -o /local/.generated
22+
cp .generated/openapi.json spec.json
23+
sudo rm -rf .generated
24+
1925
- name: Set up Go 1.x
2026
uses: actions/setup-go@v3
2127
with:

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@ test:
66
lint:
77
golangci-lint run
88

9+
.PHONY: gen-client
10+
gen-client:
11+
@command -v openapi-generator >/dev/null 2>&1 || { \
12+
echo "Error: 'openapi-generator' command not found. Please install it before running convert-spec."; \
13+
echo "On MacOS you can use Homebrew: brew install openapi-generator"; \
14+
echo "You can install it by following the instructions at: https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#1---installation"; \
15+
exit 1; \
16+
}
17+
openapi-generator generate -g openapi -i spec.json -o .openapi-tmp
18+
mv .openapi-tmp/openapi.json spec.json
19+
rm -rf .openapi-tmp
20+
go generate ./...

0 commit comments

Comments
 (0)