Skip to content

Commit b1aed92

Browse files
committed
Add OpenAPI spec validation with vacuum
1 parent 4879845 commit b1aed92

File tree

9 files changed

+326
-6
lines changed

9 files changed

+326
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
run: just build-templates
1818
- name: Run Linter
1919
run: just lint
20+
- name: Validate OpenAPI Spec
21+
run: just check-spec
2022

2123
test:
2224
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# development
1919
/fixtures
2020
/migrate-data
21+
/spec
2122

2223
# old Symfony directories/files
2324
.cache

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.15/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
33
"files": {
44
"includes": ["src/**", "*.ts", "*.json"]
55
},

cmd/spec/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import (
4+
"encoding/json"
5+
"os"
6+
7+
"pkgstatsd/internal/apidoc"
8+
)
9+
10+
func main() {
11+
data, _ := json.MarshalIndent(apidoc.BuildSpec(true), "", " ")
12+
_, _ = os.Stdout.Write(data)
13+
}

go.mod

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,108 @@ require (
1313
require (
1414
filippo.io/edwards25519 v1.2.0 // indirect
1515
github.com/a-h/parse v0.0.0-20250122154542-74294addb73e // indirect
16+
github.com/alecthomas/chroma/v2 v2.23.1 // indirect
1617
github.com/andybalholm/brotli v1.2.0 // indirect
18+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
19+
github.com/aymerick/douceur v0.2.0 // indirect
20+
github.com/bahlo/generic-list-go v0.2.0 // indirect
21+
github.com/basgys/goxml2json v1.1.1-0.20231018121955-e66ee54ceaad // indirect
22+
github.com/buger/jsonparser v1.1.1 // indirect
1723
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
24+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
25+
github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1 // indirect
26+
github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.4 // indirect
27+
github.com/charmbracelet/colorprofile v0.3.2 // indirect
28+
github.com/charmbracelet/glamour v0.10.0 // indirect
29+
github.com/charmbracelet/harmonica v0.2.0 // indirect
30+
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirect
31+
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.3 // indirect
32+
github.com/charmbracelet/x/ansi v0.10.1 // indirect
33+
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250505150409-97991a1f17d1 // indirect
34+
github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf // indirect
35+
github.com/charmbracelet/x/input v0.3.7 // indirect
36+
github.com/charmbracelet/x/term v0.2.1 // indirect
37+
github.com/charmbracelet/x/windows v0.2.1 // indirect
1838
github.com/cli/browser v1.3.0 // indirect
39+
github.com/daveshanley/vacuum v0.25.0 // indirect
40+
github.com/dlclark/regexp2 v1.11.5 // indirect
41+
github.com/dop251/goja v0.0.0-20260305124333-6a7976c22267 // indirect
42+
github.com/dop251/goja_nodejs v0.0.0-20260212111938-1f56ff5bcf14 // indirect
1943
github.com/dustin/go-humanize v1.0.1 // indirect
2044
github.com/fatih/color v1.18.0 // indirect
2145
github.com/fsnotify/fsnotify v1.9.0 // indirect
46+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
47+
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
48+
github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect
49+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
2250
github.com/google/go-cmp v0.7.0 // indirect
2351
github.com/google/pprof v0.0.0-20260302011040-a15ffb7f9dcc // indirect
2452
github.com/google/uuid v1.6.0 // indirect
53+
github.com/gorilla/css v1.0.1 // indirect
54+
github.com/gorilla/websocket v1.5.3 // indirect
55+
github.com/iancoleman/strcase v0.3.0 // indirect
56+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
57+
github.com/json-iterator/go v1.1.12 // indirect
2558
github.com/lib/pq v1.11.2 // indirect
59+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
2660
github.com/mattn/go-colorable v0.1.14 // indirect
2761
github.com/mattn/go-isatty v0.0.20 // indirect
62+
github.com/mattn/go-runewidth v0.0.16 // indirect
63+
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
64+
github.com/mitchellh/mapstructure v1.5.0 // indirect
65+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
66+
github.com/modern-go/reflect2 v1.0.2 // indirect
67+
github.com/muesli/cancelreader v0.2.2 // indirect
68+
github.com/muesli/reflow v0.3.0 // indirect
69+
github.com/muesli/termenv v0.16.0 // indirect
2870
github.com/natefinch/atomic v1.0.1 // indirect
2971
github.com/ncruces/go-strftime v1.0.0 // indirect
72+
github.com/pb33f/doctor v0.0.49 // indirect
73+
github.com/pb33f/jsonpath v0.8.1 // indirect
74+
github.com/pb33f/libopenapi v0.34.2 // indirect
75+
github.com/pb33f/libopenapi-validator v0.13.1 // indirect
76+
github.com/pb33f/ordered-map/v2 v2.3.0 // indirect
77+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
78+
github.com/petermattis/goid v0.0.0-20250508124226-395b08cebbdb // indirect
79+
github.com/pkg/errors v0.9.1 // indirect
3080
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
81+
github.com/rivo/uniseg v0.4.7 // indirect
82+
github.com/sagikazarmark/locafero v0.11.0 // indirect
83+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
84+
github.com/sasha-s/go-deadlock v0.3.5 // indirect
85+
github.com/segmentio/ksuid v1.0.4 // indirect
86+
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
87+
github.com/sourcegraph/jsonrpc2 v0.2.0 // indirect
88+
github.com/spf13/afero v1.15.0 // indirect
89+
github.com/spf13/cast v1.10.0 // indirect
90+
github.com/spf13/cobra v1.10.2 // indirect
91+
github.com/spf13/pflag v1.0.10 // indirect
92+
github.com/spf13/viper v1.21.0 // indirect
93+
github.com/subosito/gotenv v1.6.0 // indirect
94+
github.com/tliron/commonlog v0.2.19 // indirect
95+
github.com/tliron/glsp v0.2.2 // indirect
96+
github.com/tliron/kutil v0.3.26 // indirect
97+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
3198
github.com/xyproto/randomstring v1.2.0 // indirect
99+
github.com/yuin/goldmark v1.7.16 // indirect
100+
github.com/yuin/goldmark-emoji v1.0.5 // indirect
101+
go.yaml.in/yaml/v3 v3.0.4 // indirect
102+
go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect
103+
golang.org/x/crypto v0.49.0 // indirect
104+
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
32105
golang.org/x/mod v0.34.0 // indirect
33106
golang.org/x/net v0.52.0 // indirect
34107
golang.org/x/sync v0.20.0 // indirect
35108
golang.org/x/sys v0.42.0 // indirect
109+
golang.org/x/term v0.41.0 // indirect
110+
golang.org/x/text v0.35.0 // indirect
36111
golang.org/x/tools v0.43.0 // indirect
37112
modernc.org/libc v1.70.0 // indirect
38113
modernc.org/mathutil v1.7.1 // indirect
39114
modernc.org/memory v1.11.0 // indirect
40115
)
41116

42-
tool github.com/a-h/templ/cmd/templ
117+
tool (
118+
github.com/a-h/templ/cmd/templ
119+
github.com/daveshanley/vacuum
120+
)

0 commit comments

Comments
 (0)