API: generate /api/state documentation from UI types (#31530)

This commit is contained in:
Michael Geers 2026-07-23 12:03:21 +02:00 • committed by GitHub
parent bacca990ee
commit 542a01fa20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 8786 additions and 3351 deletions

View file

@ -1,28 +0,0 @@
package main
import (
"encoding/json"
"log"
"os"
"github.com/getkin/kin-openapi/openapi3"
)
func main() {
doc, err := openapi3.NewLoader().LoadFromFile(os.Args[1])
if err != nil {
log.Fatal("failed to load OpenAPI spec:", err)
}
// omit servers
doc.Servers = nil
b, err := json.MarshalIndent(doc, "", " ")
if err != nil {
log.Fatal(err)
}
if err := os.WriteFile(os.Args[2], b, 0o644); err != nil {
log.Fatal(err)
}
}