From bd6f72c204fd18d36fb3db4aeeeebb84ba796c74 Mon Sep 17 00:00:00 2001 From: brandonphelps1212 Date: Thu, 19 Nov 2026 00:42:13 -0500 Subject: [PATCH 1/2] add the vercel plugin Watches Vercel's REST API through the OpenAPI spec committed in vercel/sdk at each release tag. Emits operation deprecations (by the deprecated flag, or a summary starting "Deprecated:" or ending "(deprecated)") and removals of operations the previous spec had marked deprecated. Everything else is dropped: in the spec's history most removals and property changes weren't changes to the API. diff gains Options (PathTemplates, DeprecatedSummary) and ChangesWith; the zero value keeps Changes' behavior for the other openapi plugins. Co-Authored-By: Claude Opus 5.5 Signed-off-by: brandonphelps1212 --- adapter/vercel.go | 69 + adapter/vercel_test.go | 82 + diff/diff.go | 214 ++- diff/options_test.go | 118 ++ docs/plugins.md | 1 + plugins/openapi/openapi.go | 12 +- plugins/openapi/registered_test.go | 2 +- plugins/openapi/testdata/README.md | 4 + plugins/openapi/testdata/golden/vercel.json | 128 ++ plugins/openapi/testdata/vercel-v1.13.4.json | 577 ++++++ plugins/openapi/testdata/vercel-v1.13.5.json | 577 ++++++ plugins/openapi/testdata/vercel-v1.18.6.json | 203 ++ plugins/openapi/testdata/vercel-v1.18.7.json | 219 +++ plugins/openapi/testdata/vercel-v1.28.64.json | 739 ++++++++ plugins/openapi/testdata/vercel-v1.28.65.json | 739 ++++++++ plugins/openapi/testdata/vercel-v1.6.2.json | 1684 +++++++++++++++++ plugins/openapi/testdata/vercel-v1.6.3.json | 607 ++++++ plugins/openapi/vercel.go | 59 + plugins/openapi/vercel_test.go | 267 +++ providers/README.md | 1 + providers/vercel.md | 50 + 21 files changed, 6312 insertions(+), 40 deletions(-) create mode 100644 adapter/vercel.go create mode 100644 adapter/vercel_test.go create mode 100644 diff/options_test.go create mode 100644 plugins/openapi/testdata/golden/vercel.json create mode 100644 plugins/openapi/testdata/vercel-v1.13.4.json create mode 100644 plugins/openapi/testdata/vercel-v1.13.5.json create mode 100644 plugins/openapi/testdata/vercel-v1.18.6.json create mode 100644 plugins/openapi/testdata/vercel-v1.18.7.json create mode 100644 plugins/openapi/testdata/vercel-v1.28.64.json create mode 100644 plugins/openapi/testdata/vercel-v1.28.65.json create mode 100644 plugins/openapi/testdata/vercel-v1.6.2.json create mode 100644 plugins/openapi/testdata/vercel-v1.6.3.json create mode 100644 plugins/openapi/vercel.go create mode 100644 plugins/openapi/vercel_test.go create mode 100644 providers/vercel.md diff --git a/adapter/vercel.go b/adapter/vercel.go new file mode 100644 index 0000000..97dfbaa --- /dev/null +++ b/adapter/vercel.go @@ -0,0 +1,69 @@ +package adapter + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + "github.com/patch-it-dev/patch-it-plugins/fetch" +) + +// Variables, not constants, only so tests can point them at a local server. +var ( + vercelReleasesURL = "https://api.github.com/repos/vercel/sdk/releases/latest" + // vercelSpecURLTemplate is the REST API spec @vercel/sdk is generated from, + // committed at the root of vercel/sdk and regenerated on every release. + // Vercel also serves it live at https://openapi.vercel.sh/, but that URL + // has no versions to pin or replay. The SDK repo's copy is the same spec, + // a release behind at most (on 2026-11-18 the live one had 3 paths more + // out of 356), and tagged on every release. + vercelSpecURLTemplate = "https://raw.githubusercontent.com/vercel/sdk/%s/vercel-spec.json" +) + +// Vercel adapts the OpenAPI spec bundled in vercel/sdk for the openapi plugin. +type Vercel struct{} + +var _ Adapter = Vercel{} + +func (Vercel) API() string { return "vercel" } + +// LatestTag asks GitHub for vercel/sdk's newest release tag, e.g. "v1.28.65". +// The canary tags (v14.0.0-canary.9) aren't releases, so releases/latest never +// returns them (checked 2026-11-18). +func (Vercel) LatestTag(ctx context.Context) (string, error) { + body, err := fetch.Get(ctx, vercelReleasesURL, githubHeaders()) + if err != nil { + return "", fmt.Errorf("looking up vercel's latest release: %w", err) + } + var release struct { + TagName string `json:"tag_name"` + } + if err := json.Unmarshal(body, &release); err != nil { + return "", fmt.Errorf("parsing github release response: %w", err) + } + if release.TagName == "" { + return "", fmt.Errorf("github release response had no tag_name") + } + return release.TagName, nil +} + +// Fetch downloads the spec pinned to tag. It's JSON already, so it's passed +// through unchanged. +// +// Version is the release tag without its "v", not info.version: that is a +// fixed "0.0.1" in every release (checked 2026-11-18). The tag is what a +// customer pins in package.json ("@vercel/sdk": "1.28.65"). Vercel's REST API +// has no version of its own: each endpoint carries its own in the path +// (/v13/deployments, /v6/user/tokens). +func (Vercel) Fetch(ctx context.Context, tag string) (Spec, error) { + url := fmt.Sprintf(vercelSpecURLTemplate, tag) + body, err := fetch.Get(ctx, url, nil) // raw.githubusercontent.com needs no auth + if err != nil { + return Spec{}, fmt.Errorf("fetching vercel spec %s: %w", tag, err) + } + if !json.Valid(body) { + return Spec{}, fmt.Errorf("vercel spec %s is not valid json", tag) + } + return Spec{Content: body, Version: strings.TrimPrefix(tag, "v"), SourceURL: url}, nil +} diff --git a/adapter/vercel_test.go b/adapter/vercel_test.go new file mode 100644 index 0000000..a605beb --- /dev/null +++ b/adapter/vercel_test.go @@ -0,0 +1,82 @@ +package adapter + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" +) + +// fakeVercelGitHub serves a latest-release endpoint and specs by path, under +// vercel/sdk's URL shape. +func fakeVercelGitHub(t *testing.T, releaseJSON string, specs map[string]string) *httptest.Server { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path == "/releases/latest" { + w.Write([]byte(releaseJSON)) + return + } + body, ok := specs[r.URL.Path] + if !ok { + http.NotFound(w, r) + return + } + w.Write([]byte(body)) + })) + t.Cleanup(srv.Close) + + oldRel, oldSpec := vercelReleasesURL, vercelSpecURLTemplate + vercelReleasesURL = srv.URL + "/releases/latest" + vercelSpecURLTemplate = srv.URL + "/%s/vercel-spec.json" + t.Cleanup(func() { vercelReleasesURL, vercelSpecURLTemplate = oldRel, oldSpec }) + return srv +} + +func TestVercelLatestTagReadsTheReleaseTag(t *testing.T) { + fakeVercelGitHub(t, `{"tag_name":"v1.28.65"}`, nil) + tag, err := Vercel{}.LatestTag(context.Background()) + if err != nil || tag != "v1.28.65" { + t.Errorf("got %q, %v; want v1.28.65", tag, err) + } +} + +func TestVercelLatestTagRejectsAReleaseWithoutATag(t *testing.T) { + fakeVercelGitHub(t, `{"name":"something"}`, nil) + if _, err := (Vercel{}).LatestTag(context.Background()); err == nil { + t.Error("release without tag_name: want an error") + } +} + +// The version is the tag a customer pins, not info.version, which is "0.0.1" +// in every release; the content is passed through byte for byte. +func TestVercelFetchUsesTheTagAsVersion(t *testing.T) { + const body = `{"info":{"version":"0.0.1"},"openapi":"3.0.3","paths":{}}` + srv := fakeVercelGitHub(t, "", map[string]string{"/v1.18.7/vercel-spec.json": body}) + spec, err := Vercel{}.Fetch(context.Background(), "v1.18.7") + if err != nil { + t.Fatal(err) + } + if spec.Version != "1.18.7" { + t.Errorf("version = %q, want 1.18.7", spec.Version) + } + if spec.SourceURL != srv.URL+"/v1.18.7/vercel-spec.json" { + t.Errorf("source_url = %s, want the file actually fetched", spec.SourceURL) + } + if string(spec.Content) != body { + t.Errorf("content changed: %s", spec.Content) + } +} + +func TestVercelFetchRejectsInvalidJSON(t *testing.T) { + fakeVercelGitHub(t, "", map[string]string{"/bad/vercel-spec.json": ""}) + if _, err := (Vercel{}).Fetch(context.Background(), "bad"); err == nil { + t.Error("invalid json: want an error") + } +} + +func TestVercelFetchFailsWhenSpecDoesNotExist(t *testing.T) { + fakeVercelGitHub(t, "", nil) + if _, err := (Vercel{}).Fetch(context.Background(), "v9.9.9"); err == nil { + t.Error("missing tag: want an error") + } +} diff --git a/diff/diff.go b/diff/diff.go index 964a868..eb312f6 100644 --- a/diff/diff.go +++ b/diff/diff.go @@ -15,6 +15,7 @@ package diff import ( "encoding/json" "fmt" + "regexp" "sort" "strings" @@ -85,14 +86,51 @@ func Parse(data []byte) (*Spec, error) { // path (parameters, servers, summary) is not an operation. var methods = []string{"get", "put", "post", "delete", "patch", "head", "options", "trace"} +// Options adapts the differ to a spec whose conventions aren't Stripe's. The +// zero value is what Changes does. +type Options struct { + // PathTemplates matches an operation across the two specs by its path + // with the parameter names left out, so GET /drives/{name} and + // GET /drives/{nameOrId} are one operation: a caller sends the same URL to + // both. Path parameters are then paired by their place in the path, not + // their name. + // + // The trade: a URL that keeps its shape but changes meaning + // (/teams/{teamId} becoming /teams/{slug}) reads as no change. And when + // one spec has two paths with the same template, they're paired by exact + // path instead, so a rename there still reads as a removal. + PathTemplates bool + + // DeprecatedSummary reports whether an operation's summary marks it + // deprecated, for a spec that often says so in words and not in the + // `deprecated` flag. Nil reads only the flag. + DeprecatedSummary func(summary string) bool +} + +// OperationDeprecated reports whether an operation object is marked +// deprecated, by its flag or, when DeprecatedSummary is set, its summary. +func (o Options) OperationDeprecated(op map[string]any) bool { + return truthy(op["deprecated"]) || o.summaryDeprecated(op) +} + +func (o Options) summaryDeprecated(op map[string]any) bool { + summary, _ := op["summary"].(string) + return o.DeprecatedSummary != nil && summary != "" && o.DeprecatedSummary(summary) +} + // Changes reports what changed between two specs, oldest first. Either spec // being nil means there is nothing to compare, which is the first-run case. // Identical specs produce no changes. func Changes(oldSpec, newSpec *Spec) []Change { + return ChangesWith(oldSpec, newSpec, Options{}) +} + +// ChangesWith is Changes, adapted by opts. +func ChangesWith(oldSpec, newSpec *Spec, opts Options) []Change { if oldSpec == nil || newSpec == nil { return nil } - d := &differ{} + d := &differ{opts: opts} d.paths(obj(oldSpec.doc["paths"]), obj(newSpec.doc["paths"])) d.schemas( obj(obj(oldSpec.doc["components"])["schemas"]), @@ -112,6 +150,7 @@ func Changes(oldSpec, newSpec *Spec) []Change { } type differ struct { + opts Options changes []Change } @@ -221,46 +260,134 @@ func classify(kind Kind, side event.Side) (event.ChangeType, bool, bool) { // ---------- request side: paths ---------- func (d *differ) paths(oldPaths, newPaths map[string]any) { - for _, path := range union(oldPaths, newPaths) { - oldItem, newItem := obj(oldPaths[path]), obj(newPaths[path]) - ptrOld := "/paths/" + escape(path) - ptrNew := ptrOld - - for _, method := range methods { - oldOp, newOp := obj(oldItem[method]), obj(newItem[method]) - if oldOp == nil && newOp == nil { - continue - } - w := where{ - side: event.SideRequest, - operation: strings.ToUpper(method) + " " + path, - ptrOld: ptrOld + "/" + method, - ptrNew: ptrNew + "/" + method, - } - switch { - case oldOp == nil: - d.add(w, OperationAdded, "", false, newOp) - case newOp == nil: - d.add(w, OperationRemoved, "", true, oldOp) - default: - if !truthy(oldOp["deprecated"]) && truthy(newOp["deprecated"]) { + for _, pair := range d.operations(oldPaths, newPaths) { + method := pair.method + oldOp := obj(obj(oldPaths[pair.oldPath])[method]) + newOp := obj(obj(newPaths[pair.newPath])[method]) + path := pair.newPath + if newOp == nil { + path = pair.oldPath + } + w := where{ + side: event.SideRequest, + operation: strings.ToUpper(method) + " " + path, + ptrOld: "/paths/" + escape(pair.oldPath) + "/" + method, + ptrNew: "/paths/" + escape(pair.newPath) + "/" + method, + } + switch { + case oldOp == nil: + d.add(w, OperationAdded, "", false, newOp) + case newOp == nil: + d.add(w, OperationRemoved, "", true, oldOp) + default: + if !d.opts.OperationDeprecated(oldOp) && d.opts.OperationDeprecated(newOp) { + if truthy(newOp["deprecated"]) { d.add(w.child("deprecated"), OperationDeprecated, "", false, newOp["deprecated"]) + } else { + // Said in words: the summary is the evidence. + d.add(w.child("summary"), OperationDeprecated, "", false, newOp["summary"]) + } + } + d.parameters(w, oldOp, newOp, pathParamRenames(pair.oldPath, pair.newPath)) + d.requestBody(w, oldOp, newOp) + } + } +} + +// opPair is one operation as each spec has it. The path is empty on the side +// that lacks it; with PathTemplates the two paths may differ in their +// parameter names. +type opPair struct { + method, oldPath, newPath string +} + +// operations pairs every operation in either spec with its counterpart in the +// other, by method and path, or, with PathTemplates, by method and template. +func (d *differ) operations(oldPaths, newPaths map[string]any) []opPair { + key := func(method, path string) string { + if d.opts.PathTemplates { + path = pathParam.ReplaceAllString(path, "{}") + } + return method + " " + path + } + index := func(paths map[string]any) map[string][]string { + ix := map[string][]string{} + for path, item := range paths { + for _, method := range methods { + if obj(obj(item)[method]) != nil { + k := key(method, path) + ix[k] = append(ix[k], path) } - d.parameters(w, oldOp, newOp) - d.requestBody(w, oldOp, newOp) } } + return ix + } + oldIx, newIx := index(oldPaths), index(newPaths) + + var pairs []opPair + for _, k := range union(oldIx, newIx) { + method, _, _ := strings.Cut(k, " ") + oldList, newList := oldIx[k], newIx[k] + if len(oldList) <= 1 && len(newList) <= 1 { + p := opPair{method: method} + if len(oldList) == 1 { + p.oldPath = oldList[0] + } + if len(newList) == 1 { + p.newPath = newList[0] + } + pairs = append(pairs, p) + continue + } + // Two paths in one spec share the template, so it can't say which is + // which: pair them by exact path, as without PathTemplates. + all := map[string]struct{}{} + for _, p := range append(append([]string{}, oldList...), newList...) { + all[p] = struct{}{} + } + for _, path := range sortedKeys(all) { + p := opPair{method: method} + if _, ok := oldPaths[path]; ok && obj(obj(oldPaths[path])[method]) != nil { + p.oldPath = path + } + if _, ok := newPaths[path]; ok && obj(obj(newPaths[path])[method]) != nil { + p.newPath = path + } + pairs = append(pairs, p) + } } + return pairs +} + +// pathParam is one {parameter} in a path template. +var pathParam = regexp.MustCompile(`\{[^}]*\}`) + +// pathParamRenames maps each path parameter's name in oldPath to its name in +// newPath, by place, when the two paths are one template; nil otherwise. +func pathParamRenames(oldPath, newPath string) map[string]string { + if oldPath == newPath || oldPath == "" || newPath == "" { + return nil + } + oldNames, newNames := pathParam.FindAllString(oldPath, -1), pathParam.FindAllString(newPath, -1) + if len(oldNames) != len(newNames) { + return nil + } + renames := map[string]string{} + for i := range oldNames { + renames[strings.Trim(oldNames[i], "{}")] = strings.Trim(newNames[i], "{}") + } + return renames } // parameters compares an operation's query and path parameters by name. Their // index in the array is not stable between versions, so it is only used to -// point at the evidence. -func (d *differ) parameters(w where, oldOp, newOp map[string]any) { - oldParams := byName(oldOp["parameters"]) - oldPtr := indexByName(oldOp["parameters"]) - newParams := byName(newOp["parameters"]) - newPtr := indexByName(newOp["parameters"]) +// point at the evidence. renames gives the new name of each old path parameter +// when the path's parameter names changed. +func (d *differ) parameters(w where, oldOp, newOp map[string]any, renames map[string]string) { + oldParams := byName(oldOp["parameters"], renames) + oldPtr := indexByName(oldOp["parameters"], renames) + newParams := byName(newOp["parameters"], nil) + newPtr := indexByName(newOp["parameters"], nil) for _, name := range union(oldParams, newParams) { oldParam, newParam := obj(oldParams[name]), obj(newParams[name]) @@ -538,27 +665,40 @@ func stringSet(v any) map[string]struct{} { } // byName keys parameters by their name; indexByName remembers where each one -// sat, so the pointer can address the right array element in each spec. -func byName(v any) map[string]any { +// sat, so the pointer can address the right array element in each spec. A path +// parameter named in renames is keyed by its new name. +func byName(v any, renames map[string]string) map[string]any { params := map[string]any{} for _, item := range arr(v) { - if name, ok := obj(item)["name"].(string); ok { + if name, ok := paramName(item, renames); ok { params[name] = item } } return params } -func indexByName(v any) map[string]int { +func indexByName(v any, renames map[string]string) map[string]int { indexes := map[string]int{} for i, item := range arr(v) { - if name, ok := obj(item)["name"].(string); ok { + if name, ok := paramName(item, renames); ok { indexes[name] = i } } return indexes } +func paramName(item any, renames map[string]string) (string, bool) { + p := obj(item) + name, ok := p["name"].(string) + if !ok { + return "", false + } + if to, renamed := renames[name]; renamed && p["in"] == "path" { + return to, true + } + return name, true +} + // union lists every key in either map, sorted, so output order never depends // on Go's map iteration. func union[V any](a, b map[string]V) []string { diff --git a/diff/options_test.go b/diff/options_test.go new file mode 100644 index 0000000..8b9e4ed --- /dev/null +++ b/diff/options_test.go @@ -0,0 +1,118 @@ +package diff + +import ( + "strings" + "testing" +) + +func pathsSpec(paths string) string { + return `{"openapi":"3.0.0","info":{"version":"v"},"paths":{` + paths + `}}` +} + +func kinds(changes []Change) []string { + var got []string + for _, c := range changes { + got = append(got, string(c.Kind)+" "+c.Operation+" "+c.Property) + } + return got +} + +var endsDeprecated = func(s string) bool { return strings.HasSuffix(s, "(deprecated)") } + +// A deprecation said only in the summary is one when DeprecatedSummary says +// so, and points at the summary; without it, only the flag counts. +func TestDeprecatedSummary(t *testing.T) { + oldSpec := mustParse(t, pathsSpec(`"/v4/price":{"get":{"summary":"Check the price"}}`)) + newSpec := mustParse(t, pathsSpec(`"/v4/price":{"get":{"summary":"Check the price (deprecated)"}}`)) + + if got := Changes(oldSpec, newSpec); len(got) != 0 { + t.Errorf("without DeprecatedSummary: %v, want nothing", kinds(got)) + } + got := ChangesWith(oldSpec, newSpec, Options{DeprecatedSummary: endsDeprecated}) + if len(got) != 1 || got[0].Kind != OperationDeprecated || got[0].Pointer != "/paths/~1v4~1price/get/summary" || + got[0].Node != "Check the price (deprecated)" { + t.Fatalf("got %+v, want one operation_deprecated citing the summary", got) + } +} + +// Already deprecated in words, then flagged: not deprecated again. +func TestDeprecatedOnceWhicheverWaySaid(t *testing.T) { + oldSpec := mustParse(t, pathsSpec(`"/a":{"get":{"summary":"A (deprecated)"}}`)) + newSpec := mustParse(t, pathsSpec(`"/a":{"get":{"summary":"A (deprecated)","deprecated":true}}`)) + if got := ChangesWith(oldSpec, newSpec, Options{DeprecatedSummary: endsDeprecated}); len(got) != 0 { + t.Errorf("got %v, want nothing", kinds(got)) + } +} + +func TestOperationDeprecated(t *testing.T) { + o := Options{DeprecatedSummary: endsDeprecated} + for _, c := range []struct { + op map[string]any + want bool + }{ + {map[string]any{"deprecated": true}, true}, + {map[string]any{"summary": "A (deprecated)"}, true}, + {map[string]any{"summary": "A"}, false}, + {nil, false}, + } { + if got := o.OperationDeprecated(c.op); got != c.want { + t.Errorf("%v: got %v, want %v", c.op, got, c.want) + } + } + if (Options{}).OperationDeprecated(map[string]any{"summary": "A (deprecated)"}) { + t.Error("zero Options reads the summary") + } +} + +// Renaming a path parameter changes no URL a caller sends: with PathTemplates +// it's no change at all, and the parameter is still compared, under its new +// name. +func TestPathTemplates(t *testing.T) { + oldSpec := mustParse(t, pathsSpec(`"/drives/{name}":{"delete":{"parameters":[ + {"name":"name","in":"path","required":true,"schema":{"type":"string"}}, + {"name":"teamId","in":"query","schema":{"type":"string"}}]}}`)) + same := mustParse(t, pathsSpec(`"/drives/{nameOrId}":{"delete":{"parameters":[ + {"name":"nameOrId","in":"path","required":true,"schema":{"type":"string"}}, + {"name":"teamId","in":"query","schema":{"type":"string"}}]}}`)) + retyped := mustParse(t, pathsSpec(`"/drives/{nameOrId}":{"delete":{"parameters":[ + {"name":"nameOrId","in":"path","required":true,"schema":{"type":"integer"}}, + {"name":"teamId","in":"query","schema":{"type":"string"}}]}}`)) + + if got := kinds(Changes(oldSpec, same)); len(got) != 2 || + got[0] != "operation_added DELETE /drives/{nameOrId} " || got[1] != "operation_removed DELETE /drives/{name} " { + t.Errorf("by exact path: %v, want the removal and the addition", got) + } + if got := ChangesWith(oldSpec, same, Options{PathTemplates: true}); len(got) != 0 { + t.Errorf("by template: %v, want nothing", kinds(got)) + } + got := ChangesWith(oldSpec, retyped, Options{PathTemplates: true}) + if len(got) != 1 || got[0].Kind != TypeChanged || got[0].Operation != "DELETE /drives/{nameOrId}" || got[0].Property != "nameOrId" || + got[0].Pointer != "/paths/~1drives~1{nameOrId}/delete/parameters/0/schema" { + t.Errorf("got %+v, want the path parameter's type change under its new name", got) + } +} + +// A query parameter that happens to share an old path parameter's name isn't +// renamed with it. +func TestPathTemplatesRenameOnlyPathParameters(t *testing.T) { + oldSpec := mustParse(t, pathsSpec(`"/x/{id}":{"get":{"parameters":[ + {"name":"id","in":"path","required":true,"schema":{"type":"string"}}, + {"name":"id","in":"query","schema":{"type":"string"}}]}}`)) + newSpec := mustParse(t, pathsSpec(`"/x/{xId}":{"get":{"parameters":[ + {"name":"xId","in":"path","required":true,"schema":{"type":"string"}}]}}`)) + got := kinds(ChangesWith(oldSpec, newSpec, Options{PathTemplates: true})) + if len(got) != 1 || got[0] != "property_removed GET /x/{xId} id" { + t.Errorf("got %v, want the query parameter's removal only", got) + } +} + +// Two paths in one spec with the same template can't be told apart by it, so +// they're paired by exact path. +func TestPathTemplatesAmbiguousFallsBackToExactPaths(t *testing.T) { + both := pathsSpec(`"/d/{name}":{"get":{}},"/d/{id}":{"get":{}}`) + oldSpec, newSpec := mustParse(t, both), mustParse(t, pathsSpec(`"/d/{id}":{"get":{}}`)) + got := kinds(ChangesWith(oldSpec, newSpec, Options{PathTemplates: true})) + if len(got) != 1 || got[0] != "operation_removed GET /d/{name} " { + t.Errorf("got %v, want GET /d/{name} removed", got) + } +} diff --git a/docs/plugins.md b/docs/plugins.md index f176efb..1a11dc6 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -13,6 +13,7 @@ The table between the `plugins:start` and `plugins:end` markers is also publishe | [`datadog`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/datadog.md) | Datadog | API v2 changes between OpenAPI spec releases | `openapi` | [DataDog/datadog-api-client-python](https://github.com/DataDog/datadog-api-client-python) (`.generator/schemas/v2/openapi.yaml`) | live | | [`github`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/github.md) | GitHub | REST API changes between dated API versions | `openapi` | [github/rest-api-description](https://github.com/github/rest-api-description) | live | | [`gitlab`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/gitlab.md) | GitLab | REST API changes between releases, request side only (what callers send) | `openapi` | [gitlab-org/gitlab `doc/api/openapi`](https://gitlab.com/gitlab-org/gitlab/-/tree/master/doc/api/openapi) | live | +| [`vercel`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/vercel.md) | Vercel | REST API operations deprecated, and deprecated operations removed, between SDK releases of the spec | `openapi` | [vercel/sdk](https://github.com/vercel/sdk) (`vercel-spec.json`) | paused: merged, not in a tagged release yet, so patch-it's hosted ingestion service doesn't run it | | [`openai-models`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/openai-models.md) | OpenAI | Model deprecations and shutdown dates (Chat Completions and Responses text models) | `retirements` | [OpenAI deprecations](https://developers.openai.com/api/docs/deprecations) | live | | [`anthropic-models`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/anthropic-models.md) | Anthropic | Model deprecations and retirement dates (Messages API models) | `retirements` | [Anthropic model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations) | live | | [`anthropic`](https://github.com/patch-it-dev/patch-it-plugins/blob/main/providers/anthropic.md) | Anthropic | Parameters removed from `messages.create()` and friends in the Python SDK 1.0 | `migrationguide` | [anthropic-sdk-python MIGRATION.md](https://github.com/anthropics/anthropic-sdk-python/blob/v1.0.0/MIGRATION.md) | live | diff --git a/plugins/openapi/openapi.go b/plugins/openapi/openapi.go index 64e1049..0ce8267 100644 --- a/plugins/openapi/openapi.go +++ b/plugins/openapi/openapi.go @@ -1,5 +1,5 @@ // Package openapi is the source plugin for an API that publishes an OpenAPI -// spec per release (Stripe, Datadog, GitLab, GitHub): fetch the newest spec, +// spec per release (Stripe, Datadog, GitLab, GitHub, Vercel): fetch the newest spec, // diff it against the last one seen, normalize the changes into events, and // attach migration hints from the API's changelog when it has one. It can also // replay two given releases. @@ -30,6 +30,9 @@ func init() { // No Hints yet: GitHub's per-version CHANGELOG.md is prose with no table // at all, so there's nothing for hint.Source to key on. plugin.Register(Plugin{Adapter: adapter.GitHub{}}) + // No Hints: Vercel's changelog is product news, not keyed by API change. + // Only operation deprecations and removals are kept: see vercelKeep. + plugin.Register(Plugin{Adapter: adapter.Vercel{}, Diff: vercelDiff, Keep: vercelKeep}) } // requestSide keeps the changes to what callers send. GitLab's response @@ -50,6 +53,9 @@ type Plugin struct { // become events: for a spec whose structure changes more often than its // API does. Nil keeps every change. Keep func(diff.Change) bool + // Diff adapts the differ to the spec's conventions. The zero value is + // right for Stripe's. + Diff diff.Options } func (p Plugin) Name() string { return p.Adapter.API() } @@ -99,6 +105,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) PreviousVersion: previousVersion, NewSpecURL: newSpec.SourceURL, OldSpecURL: oldSourceURL, + DetectedAt: env.Now().UTC(), }) p.attachHints(ctx, newSpec.Version, events) converted, invalid := migrate.Fresh(events) @@ -137,6 +144,7 @@ func (p Plugin) Replay(ctx context.Context, env plugin.Env, from, to string) (pl PreviousVersion: oldSpec.Version, NewSpecURL: newSpec.SourceURL, OldSpecURL: oldSpec.SourceURL, + DetectedAt: env.Now().UTC(), }) p.attachHints(ctx, newSpec.Version, events) now := env.Now() @@ -155,7 +163,7 @@ func (p Plugin) Replay(ctx context.Context, env plugin.Env, from, to string) (pl // events diffs two parsed specs into events, applying Keep, and pointing each // event's source_pointer into the published file when the adapter reshaped it. func (p Plugin) events(oldParsed, newParsed *diff.Spec, oldContent, newContent []byte, src normalize.Source) ([]event.ChangeEvent, []error) { - changes := diff.Changes(oldParsed, newParsed) + changes := diff.ChangesWith(oldParsed, newParsed, p.Diff) if p.Keep != nil { kept := changes[:0:0] for _, c := range changes { diff --git a/plugins/openapi/registered_test.go b/plugins/openapi/registered_test.go index 0926af2..8ede23e 100644 --- a/plugins/openapi/registered_test.go +++ b/plugins/openapi/registered_test.go @@ -8,7 +8,7 @@ import ( ) func TestRegistersItself(t *testing.T) { - for _, a := range []adapter.Adapter{adapter.Stripe{}, adapter.Datadog{}, adapter.GitLab{}, adapter.GitHub{}} { + for _, a := range []adapter.Adapter{adapter.Stripe{}, adapter.Datadog{}, adapter.GitLab{}, adapter.GitHub{}, adapter.Vercel{}} { kittest.Registered(t, Plugin{Adapter: a}) } } diff --git a/plugins/openapi/testdata/README.md b/plugins/openapi/testdata/README.md index d0dd36b..9849764 100644 --- a/plugins/openapi/testdata/README.md +++ b/plugins/openapi/testdata/README.md @@ -7,5 +7,9 @@ Each pair is a real breaking change between two releases of a provider's own spe | `datadog-2.60.0.yaml`, `datadog-2.61.0.yaml` | https://raw.githubusercontent.com/DataDog/datadog-api-client-python/2.60.0/.generator/schemas/v2/openapi.yaml (and `2.61.0`) | 2026-11-13 | Apache-2.0 (datadog-api-client-python) | `queried_tags_window_seconds:` (in 2.60.0, gone in 2.61.0) | | `github-2022-11-28.json`, `github-2026-03-10.json` | https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.2022-11-28.json (and `.2026-03-10.json`) | 2026-11-14 | MIT (github/rest-api-description) | "Remove deprecated rate property from rate limit endpoint" (GitHub's breaking-changes page for 2026-03-10) | | `gitlab-v18.11.0-ee.yaml`, `gitlab-v19.0.0-ee.yaml` | https://gitlab.com/gitlab-org/gitlab/-/raw/v18.11.0-ee/doc/api/openapi/openapi_v3.yaml (and `v19.0.0-ee`) | 2026-11-15 | CC BY-SA 4.0 (GitLab's `doc/` directory) | `bitbucket_app_password:` (in v18.11.0-ee, gone in v19.0.0-ee) | +| `vercel-v1.13.4.json`, `vercel-v1.13.5.json` | https://raw.githubusercontent.com/vercel/sdk/v1.13.4/vercel-spec.json (and `v1.13.5`) | 2026-11-18 | Apache-2.0 (vercel/sdk) | "Check the price for a domain (deprecated)" (summary of `GET /v4/domains/price`, new in v1.13.5) | +| `vercel-v1.18.6.json`, `vercel-v1.18.7.json` | https://raw.githubusercontent.com/vercel/sdk/v1.18.6/vercel-spec.json (and `v1.18.7`) | 2026-11-18 | Apache-2.0 (vercel/sdk) | `"/v4/domains/price": {` (in v1.18.6, gone in v1.18.7) | +| `vercel-v1.6.2.json`, `vercel-v1.6.3.json` | https://raw.githubusercontent.com/vercel/sdk/v1.6.2/vercel-spec.json (and `v1.6.3`) | 2026-11-18 | Apache-2.0 (vercel/sdk) | `"/v1/log-drains": {` (in v1.6.2, gone in v1.6.3 without being deprecated, back in v1.15.0): the drop test | +| `vercel-v1.28.64.json`, `vercel-v1.28.65.json` | https://raw.githubusercontent.com/vercel/sdk/v1.28.64/vercel-spec.json (and `v1.28.65`) | 2026-11-18 | Apache-2.0 (vercel/sdk) | `"/v2/sandboxes/drives/{nameOrId}": {` (`DELETE` moved here from `.../{name}` in v1.28.65) | Stripe's spec isn't saved here: its tests use small specs written inline. diff --git a/plugins/openapi/testdata/golden/vercel.json b/plugins/openapi/testdata/golden/vercel.json new file mode 100644 index 0000000..9c1a600 --- /dev/null +++ b/plugins/openapi/testdata/golden/vercel.json @@ -0,0 +1,128 @@ +[ + { + "id": 1, + "fingerprint": "sha256:3ed13a96aa00836818e55222cab3da2dfa8a26582d5498f1af05c31f5d6f4069", + "api": "vercel", + "version": "1.13.5", + "previous_version": "1.13.4", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /v1/domains/{domain}/registry" + }, + "description": "Operation GET /v1/domains/{domain}/registry marked deprecated.", + "source_url": "https://raw.githubusercontent.com/vercel/sdk/v1.13.5/vercel-spec.json", + "source_pointer": "/paths/~1v1~1domains~1{domain}~1registry/get/summary", + "source_excerpt": "\"Get domain transfer info (deprecated)\"", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 2, + "fingerprint": "sha256:9063f28da001671b78c5c0095cc412ca28c892e2a0e87b8a26c15b954530cea4", + "api": "vercel", + "version": "1.13.5", + "previous_version": "1.13.4", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /v4/domains/price" + }, + "description": "Operation GET /v4/domains/price marked deprecated.", + "source_url": "https://raw.githubusercontent.com/vercel/sdk/v1.13.5/vercel-spec.json", + "source_pointer": "/paths/~1v4~1domains~1price/get/summary", + "source_excerpt": "\"Check the price for a domain (deprecated)\"", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 3, + "fingerprint": "sha256:13194122725cea31972cf361d8bf98a8f41aedb308e10a721fe800145f2afe51", + "api": "vercel", + "version": "1.13.5", + "previous_version": "1.13.4", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /v4/domains/status" + }, + "description": "Operation GET /v4/domains/status marked deprecated.", + "source_url": "https://raw.githubusercontent.com/vercel/sdk/v1.13.5/vercel-spec.json", + "source_pointer": "/paths/~1v4~1domains~1status/get/summary", + "source_excerpt": "\"Check a Domain Availability (deprecated)\"", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 4, + "fingerprint": "sha256:3230007e27b6de1ffbd000649cdd3e34ac9a31da35a9c650cdb573b5d8f939d6", + "api": "vercel", + "version": "1.13.5", + "previous_version": "1.13.4", + "change_type": "deprecation", + "breaking": false, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "POST /v5/domains/buy" + }, + "description": "Operation POST /v5/domains/buy marked deprecated.", + "source_url": "https://raw.githubusercontent.com/vercel/sdk/v1.13.5/vercel-spec.json", + "source_pointer": "/paths/~1v5~1domains~1buy/post/summary", + "source_excerpt": "\"Purchase a domain (deprecated)\"", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 5, + "fingerprint": "sha256:4f1bb30450488badb2c18e52b206ebdd7c5b1265e2e13508351e4bf99d945d05", + "api": "vercel", + "version": "1.18.7", + "previous_version": "1.18.6", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /v4/domains/price" + }, + "description": "Operation GET /v4/domains/price removed.", + "source_url": "https://raw.githubusercontent.com/vercel/sdk/v1.18.6/vercel-spec.json", + "source_pointer": "/paths/~1v4~1domains~1price/get", + "source_excerpt": "{\"description\":\"This endpoint is deprecated and replaced with the endpoint [Get price data for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-price-data-for-a-domain). Check the price to purchase a domain and how long a single purchase period is.\",\"operationId\":\"checkDomainPrice\",\"parameters\":[{\"description\":\"The name of the domain for which the price needs to be checked.\",\"in\":\"query\",\"name\":\"name\",\"required\":true,\"schema\":{\"description\":\"The name of the domain for which the price needs to be checked.\",\"example\":\"example.com\",\"type\":\"string\"}},{\"description\":\"In which status of the domain the price needs to be checked.\",\"in\":\"query\",\"name\":\"type\",\"required\":false,\"schema\":{\"description\":\"In which status of the domain the price needs to be checked.\",\"enum\":[\"new\",\"renewal\",\"transfer\",\"redemption\"],\"example\":\"new\",\"type\":\"string\"}},{\"description\":\"The Team identifier to perform the request on behalf of.\",\"in\":\"query\",\"name\":\"teamId\",\"schema\":{\"example\":\"team_1a2b3c4d5e6f7g8h9i0j1k2l\",\"type\":\"string\"}},{\"description\":\"The Team slug to perform the request on behalf of.\",\"in\":\"query\",\"name\":\"slug\",\"schema\":{\"example\":\"my-team-url-slug\",\"type\":\"string\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"description\":\"Successful response which returns the price of the domain and the period.\",\"properties\":{\"period\":{\"description\":\"The number of years the domain could be held before paying again.\",\"example\":1,\"type\":\"number\"},\"price\":{\"description\":\"The domain price in USD.\",\"example\":20,\"type\":\"number\"}},\"required\":[\"period\",\"price\"],\"type\":\"object\"}}},\"description\":\"Successful response which returns the price of the domain and the period.\"},\"400\":{\"description\":\"One of the provided values in the request query is invalid.\"},\"401\":{\"description\":\"The request is not authorized.\"},\"403\":{\"description\":\"You do not have permission to access this resource.\"},\"404\":{\"description\":\"\"},\"500\":{\"description\":\"\"}},\"security\":[{\"beare…", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + }, + { + "id": 6, + "fingerprint": "sha256:ab1fee5e9b4b891417f2c62350ae005c7e15241d877b242dfc437764201915ac", + "api": "vercel", + "version": "1.18.7", + "previous_version": "1.18.6", + "change_type": "breaking", + "breaking": true, + "subject": { + "type": "api_operation", + "kind": "operation", + "side": "request", + "operation": "GET /v4/domains/status" + }, + "description": "Operation GET /v4/domains/status removed.", + "source_url": "https://raw.githubusercontent.com/vercel/sdk/v1.18.6/vercel-spec.json", + "source_pointer": "/paths/~1v4~1domains~1status/get", + "source_excerpt": "{\"description\":\"This endpoint is deprecated and replaced with the endpoint [Get availability for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-availability-for-a-domain). Check if a domain name is available for purchase.\",\"operationId\":\"checkDomainStatus\",\"parameters\":[{\"description\":\"The name of the domain for which we would like to check the status.\",\"in\":\"query\",\"name\":\"name\",\"required\":true,\"schema\":{\"description\":\"The name of the domain for which we would like to check the status.\",\"example\":\"example.com\",\"type\":\"string\"}},{\"description\":\"The Team identifier to perform the request on behalf of.\",\"in\":\"query\",\"name\":\"teamId\",\"schema\":{\"example\":\"team_1a2b3c4d5e6f7g8h9i0j1k2l\",\"type\":\"string\"}},{\"description\":\"The Team slug to perform the request on behalf of.\",\"in\":\"query\",\"name\":\"slug\",\"schema\":{\"example\":\"my-team-url-slug\",\"type\":\"string\"}}],\"responses\":{\"200\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"available\":{\"type\":\"boolean\"}},\"required\":[\"available\"],\"type\":\"object\"}}},\"description\":\"Successful response checking if a Domain's name is available.\"},\"400\":{\"description\":\"One of the provided values in the request query is invalid.\"},\"401\":{\"description\":\"The request is not authorized.\"},\"403\":{\"description\":\"You do not have permission to access this resource.\"},\"408\":{\"description\":\"\"},\"500\":{\"description\":\"\"}},\"security\":[{\"bearerToken\":[]}],\"summary\":\"Check a Domain Availability (deprecated)\",\"tags\":[\"domains\"]}", + "confidence": 1, + "detected_at": "2026-11-14T12:00:00Z" + } +] diff --git a/plugins/openapi/testdata/vercel-v1.13.4.json b/plugins/openapi/testdata/vercel-v1.13.4.json new file mode 100644 index 0000000..5ccb676 --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.13.4.json @@ -0,0 +1,577 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v5/domains/buy": { + "post": { + "description": "Allows to purchase the specified domain.", + "operationId": "buyDomain", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Purchase a domain", + "tags": [ + "domains" + ], + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "domain": { + "properties": { + "uid": { + "type": "string" + }, + "ns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "verified": { + "type": "boolean" + }, + "created": { + "type": "number" + }, + "pending": { + "type": "boolean" + } + }, + "required": [ + "uid", + "ns", + "verified", + "created", + "pending" + ], + "type": "object" + } + }, + "required": [ + "domain" + ], + "type": "object" + } + } + } + }, + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "domain": { + "properties": { + "uid": { + "type": "string" + }, + "ns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "verified": { + "type": "boolean" + }, + "created": { + "type": "number" + }, + "pending": { + "type": "boolean" + } + }, + "required": [ + "uid", + "ns", + "verified", + "created", + "pending" + ], + "type": "object" + } + }, + "required": [ + "domain" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "409": { + "description": "" + }, + "429": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "type": "object", + "required": [ + "name", + "country", + "firstName", + "lastName", + "address1", + "city", + "state", + "postalCode", + "phone", + "email" + ], + "properties": { + "name": { + "description": "The domain name to purchase.", + "type": "string", + "example": "example.com" + }, + "expectedPrice": { + "description": "The price you expect to be charged for the purchase.", + "type": "number", + "example": 10 + }, + "renew": { + "description": "Indicates whether the domain should be automatically renewed.", + "type": "boolean", + "example": true + }, + "country": { + "description": "The country of the domain registrant", + "type": "string", + "example": "US" + }, + "orgName": { + "description": "The company name of the domain registrant", + "type": "string", + "example": "Acme Inc." + }, + "firstName": { + "description": "The first name of the domain registrant", + "type": "string", + "example": "Jane" + }, + "lastName": { + "description": "The last name of the domain registrant", + "type": "string", + "example": "Doe" + }, + "address1": { + "description": "The street address of the domain registrant", + "type": "string", + "example": "340 S Lemon Ave Suite 4133" + }, + "city": { + "description": "The city of the domain registrant", + "type": "string", + "example": "San Francisco" + }, + "state": { + "description": "The state of the domain registrant", + "type": "string", + "example": "CA" + }, + "postalCode": { + "description": "The postal code of the domain registrant", + "type": "string", + "example": "91789" + }, + "phone": { + "description": "The phone number of the domain registrant", + "type": "string", + "example": "+1.4158551452" + }, + "email": { + "description": "The email of the domain registrant", + "type": "string", + "example": "jane.doe@someplace.com" + } + } + } + } + }, + "required": true + } + } + }, + "/v4/domains/price": { + "get": { + "description": "Check the price to purchase a domain and how long a single purchase period is.", + "operationId": "checkDomainPrice", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Check the price for a domain", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "Successful response which returns the price of the domain and the period.", + "content": { + "application/json": { + "schema": { + "properties": { + "price": { + "type": "number", + "description": "The domain price in USD.", + "example": 20 + }, + "period": { + "type": "number", + "description": "The number of years the domain could be held before paying again.", + "example": 1 + } + }, + "required": [ + "price", + "period" + ], + "type": "object", + "description": "Successful response which returns the price of the domain and the period." + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "The name of the domain for which the price needs to be checked.", + "in": "query", + "required": true, + "schema": { + "description": "The name of the domain for which the price needs to be checked.", + "type": "string", + "example": "example.com" + } + }, + { + "name": "type", + "description": "In which status of the domain the price needs to be checked.", + "in": "query", + "required": false, + "schema": { + "description": "In which status of the domain the price needs to be checked.", + "type": "string", + "enum": [ + "new", + "renewal", + "transfer", + "redemption" + ], + "example": "new" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v4/domains/status": { + "get": { + "description": "Check if a domain name is available for purchase.", + "operationId": "checkDomainStatus", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Check a Domain Availability", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "Successful response checking if a Domain's name is available.", + "content": { + "application/json": { + "schema": { + "properties": { + "available": { + "type": "boolean" + } + }, + "required": [ + "available" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "408": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "The name of the domain for which we would like to check the status.", + "in": "query", + "required": true, + "schema": { + "description": "The name of the domain for which we would like to check the status.", + "type": "string", + "example": "example.com" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v1/domains/{domain}/registry": { + "get": { + "description": "Fetch domain transfer availability or transfer status if a transfer is in progress.", + "operationId": "getDomainTransfer", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Get domain transfer info.", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "properties": { + "reason": { + "type": "string" + }, + "status": { + "type": "string" + }, + "transferable": { + "type": "boolean" + }, + "transferPolicy": { + "type": "string", + "enum": [ + "charge-and-renew" + ] + } + }, + "required": [ + "reason", + "status", + "transferable", + "transferPolicy" + ], + "type": "object" + }, + { + "properties": { + "transferable": { + "type": "boolean", + "description": "Whether or not the domain is transferable" + }, + "transferPolicy": { + "nullable": true, + "type": "string", + "enum": [ + "charge-and-renew", + "no-charge-no-change", + "no-change", + "new-term", + "not-supported" + ], + "description": "The domain's transfer policy (depends on TLD requirements). `charge-and-renew`: transfer will charge for renewal and will renew the existing domain's registration. `no-charge-no-change`: transfer will have no change to registration period and does not require charge. `no-change`: transfer charge is required, but no change in registration period. `new-term`: transfer charge is required and a new registry term is set based on the transfer date. `not-supported`: transfers are not supported for this domain or TLD. `null`: This TLD is not supported by Vercel's Registrar." + }, + "reason": { + "type": "string", + "description": "Description associated with transferable state." + }, + "status": { + "type": "string", + "enum": [ + "completed", + "undef", + "pending_owner", + "pending_admin", + "pending_registry", + "cancelled", + "unknown" + ], + "description": "The current state of an ongoing transfer. `pending_owner`: Awaiting approval by domain's admin contact (every transfer begins with this status). If approval is not given within five days, the transfer is cancelled. `pending_admin`: Waiting for approval by Vercel Registrar admin. `pending_registry`: Awaiting registry approval (the transfer completes after 7 days unless it is declined by the current registrar). `completed`: The transfer completed successfully. `cancelled`: The transfer was cancelled. `undef`: No transfer exists for this domain. `unknown`: This TLD is not supported by Vercel's Registrar." + } + }, + "required": [ + "transferable", + "transferPolicy", + "reason", + "status" + ], + "type": "object" + } + ] + } + } + } + }, + "400": { + "description": "" + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + }, + { + "name": "domain", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "example.com" + } + } + ] + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.13.5.json b/plugins/openapi/testdata/vercel-v1.13.5.json new file mode 100644 index 0000000..ad90811 --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.13.5.json @@ -0,0 +1,577 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v5/domains/buy": { + "post": { + "description": "This endpoint is deprecated and replaced with the endpoint [Buy a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/buy-a-domain). Purchases the specified domain.", + "operationId": "buyDomain", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Purchase a domain (deprecated)", + "tags": [ + "domains" + ], + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "domain": { + "properties": { + "uid": { + "type": "string" + }, + "ns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "verified": { + "type": "boolean" + }, + "created": { + "type": "number" + }, + "pending": { + "type": "boolean" + } + }, + "required": [ + "uid", + "ns", + "verified", + "created", + "pending" + ], + "type": "object" + } + }, + "required": [ + "domain" + ], + "type": "object" + } + } + } + }, + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "domain": { + "properties": { + "uid": { + "type": "string" + }, + "ns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "verified": { + "type": "boolean" + }, + "created": { + "type": "number" + }, + "pending": { + "type": "boolean" + } + }, + "required": [ + "uid", + "ns", + "verified", + "created", + "pending" + ], + "type": "object" + } + }, + "required": [ + "domain" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "409": { + "description": "" + }, + "429": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "type": "object", + "required": [ + "name", + "country", + "firstName", + "lastName", + "address1", + "city", + "state", + "postalCode", + "phone", + "email" + ], + "properties": { + "name": { + "description": "The domain name to purchase.", + "type": "string", + "example": "example.com" + }, + "expectedPrice": { + "description": "The price you expect to be charged for the purchase.", + "type": "number", + "example": 10 + }, + "renew": { + "description": "Indicates whether the domain should be automatically renewed.", + "type": "boolean", + "example": true + }, + "country": { + "description": "The country of the domain registrant", + "type": "string", + "example": "US" + }, + "orgName": { + "description": "The company name of the domain registrant", + "type": "string", + "example": "Acme Inc." + }, + "firstName": { + "description": "The first name of the domain registrant", + "type": "string", + "example": "Jane" + }, + "lastName": { + "description": "The last name of the domain registrant", + "type": "string", + "example": "Doe" + }, + "address1": { + "description": "The street address of the domain registrant", + "type": "string", + "example": "340 S Lemon Ave Suite 4133" + }, + "city": { + "description": "The city of the domain registrant", + "type": "string", + "example": "San Francisco" + }, + "state": { + "description": "The state of the domain registrant", + "type": "string", + "example": "CA" + }, + "postalCode": { + "description": "The postal code of the domain registrant", + "type": "string", + "example": "91789" + }, + "phone": { + "description": "The phone number of the domain registrant", + "type": "string", + "example": "+1.4158551452" + }, + "email": { + "description": "The email of the domain registrant", + "type": "string", + "example": "jane.doe@someplace.com" + } + } + } + } + }, + "required": true + } + } + }, + "/v4/domains/price": { + "get": { + "description": "This endpoint is deprecated and replaced with the endpoint [Get price data for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-price-data-for-a-domain). Check the price to purchase a domain and how long a single purchase period is.", + "operationId": "checkDomainPrice", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Check the price for a domain (deprecated)", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "Successful response which returns the price of the domain and the period.", + "content": { + "application/json": { + "schema": { + "properties": { + "price": { + "type": "number", + "description": "The domain price in USD.", + "example": 20 + }, + "period": { + "type": "number", + "description": "The number of years the domain could be held before paying again.", + "example": 1 + } + }, + "required": [ + "price", + "period" + ], + "type": "object", + "description": "Successful response which returns the price of the domain and the period." + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "The name of the domain for which the price needs to be checked.", + "in": "query", + "required": true, + "schema": { + "description": "The name of the domain for which the price needs to be checked.", + "type": "string", + "example": "example.com" + } + }, + { + "name": "type", + "description": "In which status of the domain the price needs to be checked.", + "in": "query", + "required": false, + "schema": { + "description": "In which status of the domain the price needs to be checked.", + "type": "string", + "enum": [ + "new", + "renewal", + "transfer", + "redemption" + ], + "example": "new" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v4/domains/status": { + "get": { + "description": "This endpoint is deprecated and replaced with the endpoint [Get availability for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-availability-for-a-domain). Check if a domain name is available for purchase.", + "operationId": "checkDomainStatus", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Check a Domain Availability (deprecated)", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "Successful response checking if a Domain's name is available.", + "content": { + "application/json": { + "schema": { + "properties": { + "available": { + "type": "boolean" + } + }, + "required": [ + "available" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "408": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "The name of the domain for which we would like to check the status.", + "in": "query", + "required": true, + "schema": { + "description": "The name of the domain for which we would like to check the status.", + "type": "string", + "example": "example.com" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v1/domains/{domain}/registry": { + "get": { + "description": "This endpoint is deprecated and replaced with the endpoint [Get a domain's transfer status](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-a-domain-s-transfer-status). Fetch domain transfer availability or transfer status if a transfer is in progress.", + "operationId": "getDomainTransfer", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Get domain transfer info (deprecated)", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "properties": { + "reason": { + "type": "string" + }, + "status": { + "type": "string" + }, + "transferable": { + "type": "boolean" + }, + "transferPolicy": { + "type": "string", + "enum": [ + "charge-and-renew" + ] + } + }, + "required": [ + "reason", + "status", + "transferable", + "transferPolicy" + ], + "type": "object" + }, + { + "properties": { + "transferable": { + "type": "boolean", + "description": "Whether or not the domain is transferable" + }, + "transferPolicy": { + "nullable": true, + "type": "string", + "enum": [ + "charge-and-renew", + "no-charge-no-change", + "no-change", + "new-term", + "not-supported" + ], + "description": "The domain's transfer policy (depends on TLD requirements). `charge-and-renew`: transfer will charge for renewal and will renew the existing domain's registration. `no-charge-no-change`: transfer will have no change to registration period and does not require charge. `no-change`: transfer charge is required, but no change in registration period. `new-term`: transfer charge is required and a new registry term is set based on the transfer date. `not-supported`: transfers are not supported for this domain or TLD. `null`: This TLD is not supported by Vercel's Registrar." + }, + "reason": { + "type": "string", + "description": "Description associated with transferable state." + }, + "status": { + "type": "string", + "enum": [ + "completed", + "undef", + "pending_owner", + "pending_admin", + "pending_registry", + "cancelled", + "unknown" + ], + "description": "The current state of an ongoing transfer. `pending_owner`: Awaiting approval by domain's admin contact (every transfer begins with this status). If approval is not given within five days, the transfer is cancelled. `pending_admin`: Waiting for approval by Vercel Registrar admin. `pending_registry`: Awaiting registry approval (the transfer completes after 7 days unless it is declined by the current registrar). `completed`: The transfer completed successfully. `cancelled`: The transfer was cancelled. `undef`: No transfer exists for this domain. `unknown`: This TLD is not supported by Vercel's Registrar." + } + }, + "required": [ + "transferable", + "transferPolicy", + "reason", + "status" + ], + "type": "object" + } + ] + } + } + } + }, + "400": { + "description": "" + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + }, + { + "name": "domain", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "example.com" + } + } + ] + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.18.6.json b/plugins/openapi/testdata/vercel-v1.18.6.json new file mode 100644 index 0000000..f5e87ec --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.18.6.json @@ -0,0 +1,203 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v4/domains/price": { + "get": { + "description": "This endpoint is deprecated and replaced with the endpoint [Get price data for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-price-data-for-a-domain). Check the price to purchase a domain and how long a single purchase period is.", + "operationId": "checkDomainPrice", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Check the price for a domain (deprecated)", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "Successful response which returns the price of the domain and the period.", + "content": { + "application/json": { + "schema": { + "properties": { + "price": { + "type": "number", + "description": "The domain price in USD.", + "example": 20 + }, + "period": { + "type": "number", + "description": "The number of years the domain could be held before paying again.", + "example": 1 + } + }, + "required": [ + "period", + "price" + ], + "type": "object", + "description": "Successful response which returns the price of the domain and the period." + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "The name of the domain for which the price needs to be checked.", + "in": "query", + "required": true, + "schema": { + "description": "The name of the domain for which the price needs to be checked.", + "type": "string", + "example": "example.com" + } + }, + { + "name": "type", + "description": "In which status of the domain the price needs to be checked.", + "in": "query", + "required": false, + "schema": { + "description": "In which status of the domain the price needs to be checked.", + "type": "string", + "enum": [ + "new", + "renewal", + "transfer", + "redemption" + ], + "example": "new" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v4/domains/status": { + "get": { + "description": "This endpoint is deprecated and replaced with the endpoint [Get availability for a domain](https://vercel.com/docs/rest-api/reference/endpoints/domains-registrar/get-availability-for-a-domain). Check if a domain name is available for purchase.", + "operationId": "checkDomainStatus", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Check a Domain Availability (deprecated)", + "tags": [ + "domains" + ], + "responses": { + "200": { + "description": "Successful response checking if a Domain's name is available.", + "content": { + "application/json": { + "schema": { + "properties": { + "available": { + "type": "boolean" + } + }, + "required": [ + "available" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "408": { + "description": "" + }, + "500": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "The name of the domain for which we would like to check the status.", + "in": "query", + "required": true, + "schema": { + "description": "The name of the domain for which we would like to check the status.", + "type": "string", + "example": "example.com" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.18.7.json b/plugins/openapi/testdata/vercel-v1.18.7.json new file mode 100644 index 0000000..d30d9c2 --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.18.7.json @@ -0,0 +1,219 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel REST API \u0026 SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v1/connect/networks": { + "get": { + "description": "Allows to list Secure Compute networks.", + "operationId": "listNetworks", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "List Secure Compute networks", + "tags": [ + "connect" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Network" + }, + "type": "array" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + } + }, + "parameters": [ + { + "name": "includeHostedZones", + "description": "Whether to include Hosted Zones in the response", + "in": "query", + "schema": { + "type": "boolean", + "description": "Whether to include Hosted Zones in the response", + "default": true + } + }, + { + "name": "includePeeringConnections", + "description": "Whether to include VPC Peering connections in the response", + "in": "query", + "schema": { + "type": "boolean", + "description": "Whether to include VPC Peering connections in the response", + "default": true + } + }, + { + "name": "includeProjects", + "description": "Whether to include projects in the response", + "in": "query", + "schema": { + "type": "boolean", + "description": "Whether to include projects in the response", + "default": true + } + }, + { + "name": "search", + "description": "The query to use as a filter for returned networks", + "in": "query", + "schema": { + "type": "string", + "description": "The query to use as a filter for returned networks", + "maxLength": 255 + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + }, + "post": { + "description": "Allows to create a Secure Compute network.", + "operationId": "createNetwork", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Create a Secure Compute network", + "tags": [ + "connect" + ], + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Network" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "402": { + "description": "The account was soft-blocked for an unhandled reason.\nThe account is missing a payment so payment method must be updated" + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + } + }, + "parameters": [ + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "awsAvailabilityZoneIds": { + "type": "array", + "items": { + "type": "string", + "description": "An AWS Availability Zone ID to use for the network", + "example": "use1-az1" + }, + "minItems": 2, + "maxItems": 2 + }, + "cidr": { + "type": "string", + "description": "The CIDR block of the network", + "example": "192.168.0.0/16" + }, + "name": { + "type": "string", + "description": "The name of the network", + "maxLength": 255 + }, + "region": { + "type": "string", + "description": "The region where the network will be created", + "example": "iad1" + } + }, + "required": [ + "cidr", + "name", + "region" + ] + } + } + } + } + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.28.64.json b/plugins/openapi/testdata/vercel-v1.28.64.json new file mode 100644 index 0000000..93cd6e2 --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.28.64.json @@ -0,0 +1,739 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel REST API & SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v1/drives/{nameOrId}": { + "get": { + "description": "Gets an existing drive by project and name or drive ID. Returns 404 if doesn't exist.", + "operationId": "getDriveV1", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Get a drive", + "tags": [ + "drives" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "410": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "nameOrId", + "description": "The drive name or ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The drive name or ID.", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v1/drives/{name}": { + "post": { + "description": "Gets an existing drive by project and name, or creates it when it does not exist.", + "operationId": "getOrCreateDriveV1", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Get or create a drive", + "tags": [ + "drives" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid.\nOne of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "402": { + "description": "The account is missing a payment so payment method must be updated" + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "429": { + "description": "" + }, + "503": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "projectId": { + "type": "string", + "description": "The project ID or name to associate the drive with. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + }, + "maxSizeBytes": { + "type": "integer", + "description": "Maximum drive size in bytes. Must be a multiple of 4096 bytes. Defaults to 1 TiB when omitted (1 GiB for Hobby). The maximum quota is 16 TiB. Request a quota above 16 TiB at https://vercel.com/help." + }, + "region": { + "type": "string", + "description": "Region where the drive is stored. Defaults to iad1.", + "enum": [ + "iad1", + "sfo1", + "cle1", + "cdg1", + "fra1", + "arn1", + "sin1", + "pdx1", + "lhr1", + "icn1", + "bom1", + "cpt1", + "dub1", + "gru1", + "hkg1", + "syd1", + "yul1", + "hnd1", + "kix1" + ], + "default": "iad1", + "example": "iad1" + } + } + } + } + } + } + }, + "delete": { + "description": "Deletes a drive by project and name. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion.", + "operationId": "deleteDriveV1", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Delete a drive", + "tags": [ + "drives" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v2/sandboxes/drives/{nameOrId}": { + "get": { + "description": "Gets an existing drive by project and name or drive ID. Returns 404 if doesn't exist.", + "operationId": "getDrive", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deprecated: Use GET /v1/drives/:nameOrId. Requires the read:drive app scope instead of read:sandbox, and drive:read instead of vercelRun:read. Get a drive", + "tags": [ + "sandboxes" + ], + "deprecated": true, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "410": { + "description": "" + }, + "422": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "nameOrId", + "description": "The drive name or ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The drive name or ID.", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v2/sandboxes/drives/{name}": { + "post": { + "description": "Gets an existing drive by project and name, or creates it when it does not exist.", + "operationId": "getOrCreateDrive", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deprecated: Use POST /v1/drives/:name. Requires the read-write:drive app scope instead of read-write:sandbox, and drive:create instead of vercelRun:create.\nEmits drive-created activity events instead of sandbox-drive-created. Get or create a drive", + "tags": [ + "sandboxes" + ], + "deprecated": true, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid.\nOne of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "402": { + "description": "The account is missing a payment so payment method must be updated" + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "422": { + "description": "" + }, + "429": { + "description": "" + }, + "503": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "projectId": { + "type": "string", + "description": "The project ID or name to associate the drive with. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + }, + "maxSizeBytes": { + "type": "integer", + "description": "Maximum drive size in bytes. Must be a multiple of 4096 bytes. Defaults to 1 TiB when omitted (1 GiB for Hobby). The maximum quota is 16 TiB. Request a quota above 16 TiB at https://vercel.com/help." + }, + "region": { + "type": "string", + "description": "Region where the drive is stored. Defaults to iad1.", + "enum": [ + "iad1", + "sfo1", + "cle1", + "cdg1", + "fra1", + "arn1", + "sin1", + "pdx1", + "lhr1", + "icn1", + "bom1", + "cpt1", + "dub1", + "gru1", + "hkg1", + "syd1", + "yul1", + "hnd1", + "kix1" + ], + "default": "iad1", + "example": "iad1" + } + } + } + } + } + } + }, + "delete": { + "description": "Deletes a drive by project and name. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion.", + "operationId": "deleteDrive", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deprecated: Use DELETE /v1/drives/:name. Requires the read-write:drive app scope instead of read-write:sandbox, and drive:delete instead of vercelRun:delete.\nEmits drive-deleted activity events instead of sandbox-drive-deleted. Delete a drive", + "tags": [ + "sandboxes" + ], + "deprecated": true, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "422": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.28.65.json b/plugins/openapi/testdata/vercel-v1.28.65.json new file mode 100644 index 0000000..22d22cb --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.28.65.json @@ -0,0 +1,739 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel REST API & SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v1/drives/{nameOrId}": { + "get": { + "description": "Gets an existing drive by project and name or drive ID. Returns 404 if doesn't exist.", + "operationId": "getDriveV1", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Get a drive", + "tags": [ + "drives" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "410": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "nameOrId", + "description": "The drive name or ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The drive name or ID.", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + }, + "delete": { + "description": "Deletes a drive by project and name or drive ID. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion.", + "operationId": "deleteDriveV1", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Delete a drive", + "tags": [ + "drives" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "nameOrId", + "description": "The drive name or ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The drive name or ID.", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v1/drives/{name}": { + "post": { + "description": "Gets an existing drive by project and name, or creates it when it does not exist.", + "operationId": "getOrCreateDriveV1", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Get or create a drive", + "tags": [ + "drives" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid.\nOne of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "402": { + "description": "The account is missing a payment so payment method must be updated" + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "429": { + "description": "" + }, + "503": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "projectId": { + "type": "string", + "description": "The project ID or name to associate the drive with. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + }, + "maxSizeBytes": { + "type": "integer", + "description": "Maximum drive size in bytes. Must be a multiple of 4096 bytes. Defaults to 1 TiB when omitted (1 GiB for Hobby). The maximum quota is 16 TiB. Request a quota above 16 TiB at https://vercel.com/help." + }, + "region": { + "type": "string", + "description": "Region where the drive is stored. Defaults to iad1.", + "enum": [ + "iad1", + "sfo1", + "cle1", + "cdg1", + "fra1", + "arn1", + "sin1", + "pdx1", + "lhr1", + "icn1", + "bom1", + "cpt1", + "dub1", + "gru1", + "hkg1", + "syd1", + "yul1", + "hnd1", + "kix1" + ], + "default": "iad1", + "example": "iad1" + } + } + } + } + } + } + } + }, + "/v2/sandboxes/drives/{nameOrId}": { + "get": { + "description": "Gets an existing drive by project and name or drive ID. Returns 404 if doesn't exist.", + "operationId": "getDrive", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deprecated: Use GET /v1/drives/:nameOrId. Requires the read:drive app scope instead of read:sandbox, and drive:read instead of vercelRun:read. Get a drive", + "tags": [ + "sandboxes" + ], + "deprecated": true, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "410": { + "description": "" + }, + "422": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "nameOrId", + "description": "The drive name or ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The drive name or ID.", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + }, + "delete": { + "description": "Deletes a drive by project and name or drive ID. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion.", + "operationId": "deleteDrive", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deprecated: Use DELETE /v1/drives/:nameOrId. Requires the read-write:drive app scope instead of read-write:sandbox, and drive:delete instead of vercelRun:delete.\nEmits drive-deleted activity events instead of sandbox-drive-deleted. Delete a drive", + "tags": [ + "sandboxes" + ], + "deprecated": true, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "422": { + "description": "" + }, + "429": { + "description": "" + } + }, + "parameters": [ + { + "name": "nameOrId", + "description": "The drive name or ID.", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "The drive name or ID.", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "name": "projectId", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "The project ID or name associated with the drive. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v2/sandboxes/drives/{name}": { + "post": { + "description": "Gets an existing drive by project and name, or creates it when it does not exist.", + "operationId": "getOrCreateDrive", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deprecated: Use POST /v1/drives/:name. Requires the read-write:drive app scope instead of read-write:sandbox, and drive:create instead of vercelRun:create.\nEmits drive-created activity events instead of sandbox-drive-created. Get or create a drive", + "tags": [ + "sandboxes" + ], + "deprecated": true, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "drive": { + "$ref": "#/components/schemas/Drive" + } + }, + "required": [ + "drive" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid.\nOne of the provided values in the request query is invalid." + }, + "401": { + "description": "The request is not authorized." + }, + "402": { + "description": "The account is missing a payment so payment method must be updated" + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "" + }, + "409": { + "description": "" + }, + "410": { + "description": "" + }, + "422": { + "description": "" + }, + "429": { + "description": "" + }, + "503": { + "description": "" + } + }, + "parameters": [ + { + "name": "name", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Name for the drive. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores).", + "pattern": "^[a-zA-Z0-9_-]+$", + "maxLength": 64, + "example": "workspace" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "projectId": { + "type": "string", + "description": "The project ID or name to associate the drive with. Required unless using a Vercel OIDC token scoped to a project.", + "example": "prj_abc123" + }, + "maxSizeBytes": { + "type": "integer", + "description": "Maximum drive size in bytes. Must be a multiple of 4096 bytes. Defaults to 1 TiB when omitted (1 GiB for Hobby). The maximum quota is 16 TiB. Request a quota above 16 TiB at https://vercel.com/help." + }, + "region": { + "type": "string", + "description": "Region where the drive is stored. Defaults to iad1.", + "enum": [ + "iad1", + "sfo1", + "cle1", + "cdg1", + "fra1", + "arn1", + "sin1", + "pdx1", + "lhr1", + "icn1", + "bom1", + "cpt1", + "dub1", + "gru1", + "hkg1", + "syd1", + "yul1", + "hnd1", + "kix1" + ], + "default": "iad1", + "example": "iad1" + } + } + } + } + } + } + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.6.2.json b/plugins/openapi/testdata/vercel-v1.6.2.json new file mode 100644 index 0000000..384c917 --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.6.2.json @@ -0,0 +1,1684 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v1/log-drains/{id}": { + "get": { + "description": "Retrieves a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be accessed.", + "operationId": "getConfigurableLogDrain", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Retrieves a Configurable Log Drain", + "tags": [ + "logDrains" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "clientId": { + "type": "string" + }, + "configurationId": { + "type": "string" + }, + "sources": { + "items": { + "type": "string", + "enum": [ + "build", + "edge", + "lambda", + "static", + "external", + "firewall" + ] + }, + "type": "array" + }, + "environments": { + "items": { + "type": "string", + "enum": [ + "production", + "preview" + ] + }, + "type": "array" + }, + "disabledBy": { + "type": "string" + }, + "firstErrorTimestamp": { + "type": "number" + }, + "samplingRate": { + "type": "number" + }, + "hideIpAddresses": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "number" + }, + "deletedAt": { + "nullable": true, + "type": "number" + }, + "updatedAt": { + "type": "number" + }, + "url": { + "type": "string" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "projectIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string" + }, + "teamId": { + "nullable": true, + "type": "string" + }, + "ownerId": { + "type": "string" + }, + "createdFrom": { + "type": "string", + "enum": [ + "self-served", + "integration" + ] + }, + "deliveryFormat": { + "type": "string", + "enum": [ + "json", + "ndjson", + "syslog", + "protobuf" + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled", + "errored" + ] + }, + "disabledAt": { + "type": "number" + }, + "disabledReason": { + "type": "string", + "enum": [ + "disabled-by-owner", + "feature-not-available", + "account-plan-downgrade", + "disabled-by-admin" + ] + }, + "secret": { + "type": "string" + } + }, + "required": [ + "environments", + "id", + "createdAt", + "deletedAt", + "updatedAt", + "url", + "name", + "ownerId", + "deliveryFormat", + "secret" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelForbiddenError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelNotFoundError" + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + }, + "delete": { + "description": "Deletes a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be deleted.", + "operationId": "deleteConfigurableLogDrain", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deletes a Configurable Log Drain", + "tags": [ + "logDrains" + ], + "responses": { + "204": { + "description": "" + }, + "400": { + "description": "One of the provided values in the request query is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelForbiddenError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelNotFoundError" + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + }, + "/v1/log-drains": { + "get": { + "description": "Retrieves a list of all the Log Drains owned by the account. This endpoint must be called with an account AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated account can be accessed.", + "operationId": "getAllLogDrains", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Retrieves a list of all the Log Drains", + "tags": [ + "logDrains" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "clientId": { + "type": "string" + }, + "configurationId": { + "type": "string" + }, + "sources": { + "items": { + "type": "string", + "enum": [ + "build", + "edge", + "lambda", + "static", + "external", + "firewall" + ] + }, + "type": "array" + }, + "environments": { + "items": { + "type": "string", + "enum": [ + "production", + "preview" + ] + }, + "type": "array" + }, + "disabledBy": { + "type": "string" + }, + "firstErrorTimestamp": { + "type": "number" + }, + "samplingRate": { + "type": "number" + }, + "hideIpAddresses": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "number" + }, + "deletedAt": { + "nullable": true, + "type": "number" + }, + "updatedAt": { + "type": "number" + }, + "url": { + "type": "string" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "projectIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string" + }, + "teamId": { + "nullable": true, + "type": "string" + }, + "ownerId": { + "type": "string" + }, + "createdFrom": { + "type": "string", + "enum": [ + "self-served", + "integration", + "integration" + ] + }, + "deliveryFormat": { + "type": "string", + "enum": [ + "json", + "ndjson", + "syslog", + "protobuf" + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled", + "errored" + ] + }, + "disabledAt": { + "type": "number" + }, + "disabledReason": { + "type": "string", + "enum": [ + "disabled-by-owner", + "feature-not-available", + "account-plan-downgrade", + "disabled-by-admin" + ] + }, + "secret": { + "type": "string" + } + }, + "type": "object", + "required": [ + "id", + "deliveryFormat", + "url", + "name", + "ownerId", + "createdAt", + "deletedAt", + "updatedAt", + "environments" + ] + }, + "type": "array" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelForbiddenError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + } + }, + "parameters": [ + { + "name": "projectId", + "in": "query", + "schema": { + "pattern": "^[a-zA-z0-9_]+$", + "type": "string" + } + }, + { + "name": "projectIdOrName", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + }, + "post": { + "description": "Creates a configurable log drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed)", + "operationId": "createConfigurableLogDrain", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Creates a Configurable Log Drain", + "tags": [ + "logDrains" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "secret": { + "type": "string", + "description": "The secret to validate the log-drain payload" + }, + "clientId": { + "type": "string" + }, + "configurationId": { + "type": "string" + }, + "sources": { + "items": { + "type": "string", + "enum": [ + "build", + "edge", + "lambda", + "static", + "external", + "firewall" + ] + }, + "type": "array" + }, + "environments": { + "items": { + "type": "string", + "enum": [ + "production", + "preview" + ] + }, + "type": "array" + }, + "disabledBy": { + "type": "string" + }, + "firstErrorTimestamp": { + "type": "number" + }, + "samplingRate": { + "type": "number" + }, + "hideIpAddresses": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "number" + }, + "deletedAt": { + "nullable": true, + "type": "number" + }, + "updatedAt": { + "type": "number" + }, + "url": { + "type": "string" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "projectIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string" + }, + "teamId": { + "nullable": true, + "type": "string" + }, + "ownerId": { + "type": "string" + }, + "createdFrom": { + "type": "string", + "enum": [ + "self-served", + "integration" + ] + }, + "deliveryFormat": { + "type": "string", + "enum": [ + "json", + "ndjson", + "syslog", + "protobuf" + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled", + "errored" + ] + }, + "disabledAt": { + "type": "number" + }, + "disabledReason": { + "type": "string", + "enum": [ + "disabled-by-owner", + "feature-not-available", + "account-plan-downgrade", + "disabled-by-admin" + ] + } + }, + "required": [ + "environments", + "id", + "createdAt", + "deletedAt", + "updatedAt", + "url", + "name", + "ownerId", + "deliveryFormat" + ], + "type": "object" + } + } + } + }, + "400": { + "description": "One of the provided values in the request body is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelForbiddenError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + } + }, + "parameters": [ + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "deliveryFormat", + "url", + "sources" + ], + "properties": { + "deliveryFormat": { + "description": "The delivery log format", + "example": "json", + "enum": [ + "json", + "ndjson" + ] + }, + "url": { + "description": "The log drain url", + "format": "uri", + "pattern": "^(http|https)?://", + "type": "string" + }, + "headers": { + "description": "Headers to be sent together with the request", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "projectIds": { + "minItems": 1, + "maxItems": 50, + "type": "array", + "items": { + "pattern": "^[a-zA-z0-9_]+$", + "type": "string" + } + }, + "sources": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "static", + "lambda", + "build", + "edge", + "external", + "firewall" + ] + }, + "minItems": 1 + }, + "environments": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "preview", + "production" + ] + }, + "minItems": 1 + }, + "secret": { + "description": "Custom secret of log drain", + "type": "string" + }, + "samplingRate": { + "type": "number", + "description": "The sampling rate for this log drain. It should be a percentage rate between 0 and 100. With max 2 decimal points", + "minimum": 0.01, + "maximum": 1, + "multipleOf": 0.01 + }, + "name": { + "type": "string", + "description": "The custom name of this log drain." + } + } + } + } + }, + "required": true + } + } + }, + "/v1/integrations/git-namespaces": { + "get": { + "description": "Lists git namespaces for a supported provider. Supported providers are `github`, `gitlab` and `bitbucket`. If the provider is not provided, it will try to obtain it from the user that authenticated the request.", + "operationId": "gitNamespaces", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "List git namespaces by provider", + "tags": [ + "integrations" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "items": { + "properties": { + "provider": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "ownerType": { + "type": "string" + }, + "name": { + "type": "string" + }, + "isAccessRestricted": { + "type": "boolean" + }, + "installationId": { + "type": "number" + }, + "requireReauth": { + "type": "boolean" + } + }, + "required": [ + "provider", + "slug", + "id", + "ownerType" + ], + "type": "object" + }, + "type": "array" + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelForbiddenError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + } + }, + "parameters": [ + { + "name": "host", + "description": "The custom Git host if using a custom Git provider, like GitHub Enterprise Server", + "in": "query", + "schema": { + "description": "The custom Git host if using a custom Git provider, like GitHub Enterprise Server", + "type": "string", + "example": "ghes-test.now.systems" + } + }, + { + "name": "provider", + "in": "query", + "schema": { + "enum": [ + "github", + "github-custom-host", + "gitlab", + "bitbucket" + ] + } + } + ] + } + }, + "/v1/integrations/search-repo": { + "get": { + "description": "Lists git repositories linked to a namespace `id` for a supported provider. A specific namespace `id` can be obtained via the `git-namespaces` endpoint. Supported providers are `github`, `gitlab` and `bitbucket`. If the provider or namespace is not provided, it will try to obtain it from the user that authenticated the request.", + "operationId": "searchRepo", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "List git repositories linked to namespace by provider", + "tags": [ + "integrations" + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object" + }, + { + "properties": { + "gitAccount": { + "properties": { + "provider": { + "type": "string", + "enum": [ + "github", + "github-custom-host", + "gitlab", + "bitbucket" + ] + }, + "namespaceId": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "provider", + "namespaceId" + ], + "type": "object" + }, + "repos": { + "items": { + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "provider": { + "type": "string", + "enum": [ + "github", + "github-custom-host", + "gitlab", + "bitbucket" + ] + }, + "url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "owner": { + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "ownerType": { + "type": "string", + "enum": [ + "user", + "team" + ] + }, + "private": { + "type": "boolean" + }, + "defaultBranch": { + "type": "string" + }, + "updatedAt": { + "type": "number" + } + }, + "required": [ + "id", + "provider", + "url", + "name", + "slug", + "namespace", + "owner", + "ownerType", + "private", + "defaultBranch", + "updatedAt" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "gitAccount", + "repos" + ], + "type": "object" + } + ] + } + } + } + }, + "400": { + "description": "One of the provided values in the request query is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + } + }, + "parameters": [ + { + "name": "query", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "namespaceId", + "in": "query", + "schema": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + { + "name": "provider", + "in": "query", + "schema": { + "enum": [ + "github", + "github-custom-host", + "gitlab", + "bitbucket" + ] + } + }, + { + "name": "installationId", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "host", + "description": "The custom Git host if using a custom Git provider, like GitHub Enterprise Server", + "in": "query", + "schema": { + "description": "The custom Git host if using a custom Git provider, like GitHub Enterprise Server", + "type": "string", + "example": "ghes-test.now.systems" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + } + }, + "components": { + "schemas": { + "AuthUser": { + "properties": { + "createdAt": { + "type": "number", + "description": "UNIX timestamp (in milliseconds) when the User account was created.", + "example": 1630748523395 + }, + "softBlock": { + "nullable": true, + "properties": { + "blockedAt": { + "type": "number" + }, + "reason": { + "type": "string", + "enum": [ + "SUBSCRIPTION_CANCELED", + "SUBSCRIPTION_EXPIRED", + "UNPAID_INVOICE", + "ENTERPRISE_TRIAL_ENDED", + "FAIR_USE_LIMITS_EXCEEDED", + "BLOCKED_FOR_PLATFORM_ABUSE" + ] + }, + "blockedDueToOverageType": { + "type": "string", + "enum": [ + "aiCredits", + "analyticsUsage", + "artifacts", + "bandwidth", + "blobTotalAdvancedRequests", + "blobTotalAvgSizeInBytes", + "blobTotalGetResponseObjectSizeInBytes", + "blobTotalSimpleRequests", + "dataCacheRead", + "dataCacheWrite", + "edgeConfigRead", + "edgeConfigWrite", + "edgeFunctionExecutionUnits", + "edgeMiddlewareInvocations", + "edgeRequestAdditionalCpuDuration", + "edgeRequest", + "elasticConcurrencyBuildSlots", + "fastDataTransfer", + "fastOriginTransfer", + "functionDuration", + "functionInvocation", + "imageOptimizationCacheRead", + "imageOptimizationCacheWrite", + "imageOptimizationTransformation", + "logDrainsVolume", + "monitoringMetric", + "blobDataTransfer", + "observabilityEvent", + "postgresComputeTime", + "postgresDataStorage", + "postgresDataTransfer", + "postgresDatabase", + "postgresWrittenData", + "serverlessFunctionExecution", + "sourceImages", + "storageRedisTotalBandwidthInBytes", + "storageRedisTotalCommands", + "storageRedisTotalDailyAvgStorageInBytes", + "storageRedisTotalDatabases", + "wafOwaspExcessBytes", + "wafOwaspRequests", + "wafRateLimitRequest", + "webAnalyticsEvent" + ] + } + }, + "required": [ + "blockedAt", + "reason" + ], + "type": "object", + "description": "When the User account has been \"soft blocked\", this property will contain the date when the restriction was enacted, and the identifier for why." + }, + "billing": { + "nullable": true, + "type": "object", + "description": "An object containing billing infomation associated with the User account." + }, + "resourceConfig": { + "properties": { + "nodeType": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "concurrentBuilds": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "buildEntitlements": { + "properties": { + "enhancedBuilds": { + "type": "boolean", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + } + }, + "type": "object", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "awsAccountType": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "awsAccountIds": { + "items": { + "type": "string" + }, + "type": "array", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "cfZoneName": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "imageOptimizationType": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeConfigs": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeConfigSize": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeFunctionMaxSizeBytes": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeFunctionExecutionTimeoutMs": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "serverlessFunctionDefaultMaxExecutionTime": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "serverlessFunctionMaxMemorySize": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "kvDatabases": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "postgresDatabases": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "blobStores": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "integrationStores": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "cronJobs": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "cronJobsPerProject": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "microfrontendGroupsPerTeam": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "microfrontendProjectsPerGroup": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "flagsExplorerOverridesThreshold": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "flagsExplorerUnlimitedOverrides": { + "type": "boolean", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + } + }, + "type": "object", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "stagingPrefix": { + "type": "string", + "description": "Prefix that will be used in the URL of \"Preview\" deployments created by the User account." + }, + "activeDashboardViews": { + "items": { + "properties": { + "scopeId": { + "type": "string" + }, + "viewPreference": { + "nullable": true, + "type": "string", + "enum": [ + "list", + "cards" + ] + }, + "favoritesViewPreference": { + "nullable": true, + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "recentsViewPreference": { + "nullable": true, + "type": "string", + "enum": [ + "open", + "closed" + ] + } + }, + "required": [ + "scopeId" + ], + "type": "object", + "description": "set of dashboard view preferences (cards or list) per scopeId" + }, + "type": "array", + "description": "set of dashboard view preferences (cards or list) per scopeId" + }, + "importFlowGitNamespace": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "importFlowGitNamespaceId": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "importFlowGitProvider": { + "nullable": true, + "type": "string", + "enum": [ + "github", + "gitlab", + "bitbucket" + ] + }, + "preferredScopesAndGitNamespaces": { + "items": { + "properties": { + "scopeId": { + "type": "string" + }, + "gitNamespaceId": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "scopeId", + "gitNamespaceId" + ], + "type": "object" + }, + "type": "array" + }, + "dismissedToasts": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "dismissals": { + "items": { + "properties": { + "scopeId": { + "type": "string" + }, + "createdAt": { + "type": "number" + } + }, + "required": [ + "scopeId", + "createdAt" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "dismissals" + ], + "type": "object", + "description": "A record of when, under a certain scopeId, a toast was dismissed" + }, + "type": "array", + "description": "A record of when, under a certain scopeId, a toast was dismissed" + }, + "favoriteProjectsAndSpaces": { + "items": { + "properties": { + "teamId": { + "type": "string" + }, + "projectId": { + "type": "string" + } + }, + "required": [ + "teamId", + "projectId" + ], + "type": "object", + "description": "A list of projects and spaces across teams that a user has marked as a favorite." + }, + "type": "array", + "description": "A list of projects and spaces across teams that a user has marked as a favorite." + }, + "hasTrialAvailable": { + "type": "boolean", + "description": "Whether the user has a trial available for a paid plan subscription." + }, + "remoteCaching": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object", + "description": "remote caching settings" + }, + "dataCache": { + "properties": { + "excessBillingEnabled": { + "type": "boolean" + } + }, + "type": "object", + "description": "data cache settings" + }, + "featureBlocks": { + "properties": { + "webAnalytics": { + "properties": { + "blockedFrom": { + "type": "number" + }, + "blockedUntil": { + "type": "number" + }, + "isCurrentlyBlocked": { + "type": "boolean" + } + }, + "required": [ + "isCurrentlyBlocked" + ], + "type": "object" + } + }, + "type": "object", + "description": "Feature blocks for the user" + }, + "northstarMigration": { + "properties": { + "teamId": { + "type": "string", + "description": "The ID of the team we created for this user." + }, + "projects": { + "type": "number", + "description": "The number of projects migrated for this user." + }, + "stores": { + "type": "number", + "description": "The number of stores migrated for this user." + }, + "integrationConfigurations": { + "type": "number", + "description": "The number of integration configurations migrated for this user." + }, + "integrationClients": { + "type": "number", + "description": "The number of integration clients migrated for this user." + }, + "startTime": { + "type": "number", + "description": "The migration start time timestamp for this user." + }, + "endTime": { + "type": "number", + "description": "The migration end time timestamp for this user." + } + }, + "required": [ + "teamId", + "projects", + "stores", + "integrationConfigurations", + "integrationClients", + "startTime", + "endTime" + ], + "type": "object" + }, + "id": { + "type": "string", + "description": "The User's unique identifier.", + "example": "AEIIDYVk59zbFF2Sxfyxxmua" + }, + "email": { + "type": "string", + "description": "Email address associated with the User account.", + "example": "me@example.com" + }, + "name": { + "nullable": true, + "type": "string", + "description": "Name associated with the User account, or `null` if none has been provided.", + "example": "John Doe" + }, + "username": { + "type": "string", + "description": "Unique username associated with the User account.", + "example": "jdoe" + }, + "avatar": { + "nullable": true, + "type": "string", + "description": "SHA1 hash of the avatar for the User account. Can be used in conjuction with the ... endpoint to retrieve the avatar image.", + "example": "22cb30c85ff45ac4c72de8981500006b28114aa1" + }, + "defaultTeamId": { + "nullable": true, + "type": "string", + "description": "The user's default team." + }, + "version": { + "type": "string", + "enum": [ + "northstar" + ], + "description": "The user's version. Will always be `northstar`." + } + }, + "required": [ + "createdAt", + "softBlock", + "billing", + "resourceConfig", + "stagingPrefix", + "hasTrialAvailable", + "id", + "email", + "name", + "username", + "avatar", + "defaultTeamId", + "version" + ], + "type": "object", + "description": "Data for the currently authenticated User." + } + } + } +} diff --git a/plugins/openapi/testdata/vercel-v1.6.3.json b/plugins/openapi/testdata/vercel-v1.6.3.json new file mode 100644 index 0000000..96c6fb6 --- /dev/null +++ b/plugins/openapi/testdata/vercel-v1.6.3.json @@ -0,0 +1,607 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Vercel SDK", + "description": "The [`@vercel/sdk`](https://www.npmjs.com/package/@vercel/sdk) is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to [install it](https://vercel.com/docs/rest-api/sdk#installing-vercel-sdk) and [authenticate](https://vercel.com/docs/rest-api/sdk#authentication) with a Vercel access token.", + "contact": { + "email": "support@vercel.com", + "name": "Vercel Support", + "url": "https://vercel.com/support" + }, + "version": "0.0.1" + }, + "paths": { + "/v1/log-drains/{id}": { + "delete": { + "description": "Deletes a Configurable Log Drain. This endpoint must be called with a team AccessToken (integration OAuth2 clients are not allowed). Only log drains owned by the authenticated team can be deleted.", + "operationId": "deleteConfigurableLogDrain", + "security": [ + { + "bearerToken": [] + } + ], + "summary": "Deletes a Configurable Log Drain", + "tags": [ + "logDrains" + ], + "responses": { + "204": { + "description": "" + }, + "400": { + "description": "One of the provided values in the request query is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelBadRequestError" + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelForbiddenError" + } + } + } + }, + "403": { + "description": "You do not have permission to access this resource." + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VercelNotFoundError" + } + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The Team identifier to perform the request on behalf of.", + "in": "query", + "name": "teamId", + "schema": { + "type": "string", + "example": "team_1a2b3c4d5e6f7g8h9i0j1k2l" + } + }, + { + "description": "The Team slug to perform the request on behalf of.", + "in": "query", + "name": "slug", + "schema": { + "type": "string", + "example": "my-team-url-slug" + } + } + ] + } + } + }, + "components": { + "schemas": { + "AuthUser": { + "properties": { + "createdAt": { + "type": "number", + "description": "UNIX timestamp (in milliseconds) when the User account was created.", + "example": 1630748523395 + }, + "softBlock": { + "nullable": true, + "properties": { + "blockedAt": { + "type": "number" + }, + "reason": { + "type": "string", + "enum": [ + "SUBSCRIPTION_CANCELED", + "SUBSCRIPTION_EXPIRED", + "UNPAID_INVOICE", + "ENTERPRISE_TRIAL_ENDED", + "FAIR_USE_LIMITS_EXCEEDED", + "BLOCKED_FOR_PLATFORM_ABUSE" + ] + }, + "blockedDueToOverageType": { + "type": "string", + "enum": [ + "aiCredits", + "analyticsUsage", + "artifacts", + "bandwidth", + "blobTotalAdvancedRequests", + "blobTotalAvgSizeInBytes", + "blobTotalGetResponseObjectSizeInBytes", + "blobTotalSimpleRequests", + "dataCacheRead", + "dataCacheWrite", + "edgeConfigRead", + "edgeConfigWrite", + "edgeFunctionExecutionUnits", + "edgeMiddlewareInvocations", + "edgeRequestAdditionalCpuDuration", + "edgeRequest", + "elasticConcurrencyBuildSlots", + "fastDataTransfer", + "fastOriginTransfer", + "functionDuration", + "functionInvocation", + "imageOptimizationCacheRead", + "imageOptimizationCacheWrite", + "imageOptimizationTransformation", + "logDrainsVolume", + "monitoringMetric", + "blobDataTransfer", + "observabilityEvent", + "postgresComputeTime", + "postgresDataStorage", + "postgresDataTransfer", + "postgresDatabase", + "postgresWrittenData", + "serverlessFunctionExecution", + "sourceImages", + "storageRedisTotalBandwidthInBytes", + "storageRedisTotalCommands", + "storageRedisTotalDailyAvgStorageInBytes", + "storageRedisTotalDatabases", + "wafOwaspExcessBytes", + "wafOwaspRequests", + "wafRateLimitRequest", + "webAnalyticsEvent" + ] + } + }, + "required": [ + "blockedAt", + "reason" + ], + "type": "object", + "description": "When the User account has been \"soft blocked\", this property will contain the date when the restriction was enacted, and the identifier for why." + }, + "billing": { + "nullable": true, + "type": "object", + "description": "An object containing billing infomation associated with the User account." + }, + "resourceConfig": { + "properties": { + "nodeType": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "concurrentBuilds": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "buildEntitlements": { + "properties": { + "enhancedBuilds": { + "type": "boolean", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + } + }, + "type": "object", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "awsAccountType": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "awsAccountIds": { + "items": { + "type": "string" + }, + "type": "array", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "cfZoneName": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "imageOptimizationType": { + "type": "string", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeConfigs": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeConfigSize": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeFunctionMaxSizeBytes": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "edgeFunctionExecutionTimeoutMs": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "serverlessFunctionDefaultMaxExecutionTime": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "serverlessFunctionMaxMemorySize": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "kvDatabases": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "postgresDatabases": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "blobStores": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "integrationStores": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "cronJobs": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "cronJobsPerProject": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "microfrontendGroupsPerTeam": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "microfrontendProjectsPerGroup": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "flagsExplorerOverridesThreshold": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "flagsExplorerUnlimitedOverrides": { + "type": "boolean", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "buildMachine": { + "properties": { + "cores": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "memory": { + "type": "number", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + } + }, + "type": "object", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + } + }, + "type": "object", + "description": "An object containing infomation related to the amount of platform resources may be allocated to the User account." + }, + "stagingPrefix": { + "type": "string", + "description": "Prefix that will be used in the URL of \"Preview\" deployments created by the User account." + }, + "activeDashboardViews": { + "items": { + "properties": { + "scopeId": { + "type": "string" + }, + "viewPreference": { + "nullable": true, + "type": "string", + "enum": [ + "list", + "cards" + ] + }, + "favoritesViewPreference": { + "nullable": true, + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "recentsViewPreference": { + "nullable": true, + "type": "string", + "enum": [ + "open", + "closed" + ] + } + }, + "required": [ + "scopeId" + ], + "type": "object", + "description": "set of dashboard view preferences (cards or list) per scopeId" + }, + "type": "array", + "description": "set of dashboard view preferences (cards or list) per scopeId" + }, + "importFlowGitNamespace": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "importFlowGitNamespaceId": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "importFlowGitProvider": { + "nullable": true, + "type": "string", + "enum": [ + "github", + "gitlab", + "bitbucket" + ] + }, + "preferredScopesAndGitNamespaces": { + "items": { + "properties": { + "scopeId": { + "type": "string" + }, + "gitNamespaceId": { + "nullable": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "scopeId", + "gitNamespaceId" + ], + "type": "object" + }, + "type": "array" + }, + "dismissedToasts": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "dismissals": { + "items": { + "properties": { + "scopeId": { + "type": "string" + }, + "createdAt": { + "type": "number" + } + }, + "required": [ + "scopeId", + "createdAt" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "dismissals" + ], + "type": "object", + "description": "A record of when, under a certain scopeId, a toast was dismissed" + }, + "type": "array", + "description": "A record of when, under a certain scopeId, a toast was dismissed" + }, + "favoriteProjectsAndSpaces": { + "items": { + "properties": { + "teamId": { + "type": "string" + }, + "projectId": { + "type": "string" + } + }, + "required": [ + "teamId", + "projectId" + ], + "type": "object", + "description": "A list of projects and spaces across teams that a user has marked as a favorite." + }, + "type": "array", + "description": "A list of projects and spaces across teams that a user has marked as a favorite." + }, + "hasTrialAvailable": { + "type": "boolean", + "description": "Whether the user has a trial available for a paid plan subscription." + }, + "remoteCaching": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object", + "description": "remote caching settings" + }, + "dataCache": { + "properties": { + "excessBillingEnabled": { + "type": "boolean" + } + }, + "type": "object", + "description": "data cache settings" + }, + "featureBlocks": { + "properties": { + "webAnalytics": { + "properties": { + "blockedFrom": { + "type": "number" + }, + "blockedUntil": { + "type": "number" + }, + "isCurrentlyBlocked": { + "type": "boolean" + } + }, + "required": [ + "isCurrentlyBlocked" + ], + "type": "object" + } + }, + "type": "object", + "description": "Feature blocks for the user" + }, + "northstarMigration": { + "properties": { + "teamId": { + "type": "string", + "description": "The ID of the team we created for this user." + }, + "projects": { + "type": "number", + "description": "The number of projects migrated for this user." + }, + "stores": { + "type": "number", + "description": "The number of stores migrated for this user." + }, + "integrationConfigurations": { + "type": "number", + "description": "The number of integration configurations migrated for this user." + }, + "integrationClients": { + "type": "number", + "description": "The number of integration clients migrated for this user." + }, + "startTime": { + "type": "number", + "description": "The migration start time timestamp for this user." + }, + "endTime": { + "type": "number", + "description": "The migration end time timestamp for this user." + } + }, + "required": [ + "teamId", + "projects", + "stores", + "integrationConfigurations", + "integrationClients", + "startTime", + "endTime" + ], + "type": "object" + }, + "id": { + "type": "string", + "description": "The User's unique identifier.", + "example": "AEIIDYVk59zbFF2Sxfyxxmua" + }, + "email": { + "type": "string", + "description": "Email address associated with the User account.", + "example": "me@example.com" + }, + "name": { + "nullable": true, + "type": "string", + "description": "Name associated with the User account, or `null` if none has been provided.", + "example": "John Doe" + }, + "username": { + "type": "string", + "description": "Unique username associated with the User account.", + "example": "jdoe" + }, + "avatar": { + "nullable": true, + "type": "string", + "description": "SHA1 hash of the avatar for the User account. Can be used in conjuction with the ... endpoint to retrieve the avatar image.", + "example": "22cb30c85ff45ac4c72de8981500006b28114aa1" + }, + "defaultTeamId": { + "nullable": true, + "type": "string", + "description": "The user's default team." + }, + "version": { + "type": "string", + "enum": [ + "northstar" + ], + "description": "The user's version. Will always be `northstar`." + } + }, + "required": [ + "createdAt", + "softBlock", + "billing", + "resourceConfig", + "stagingPrefix", + "hasTrialAvailable", + "id", + "email", + "name", + "username", + "avatar", + "defaultTeamId", + "version" + ], + "type": "object", + "description": "Data for the currently authenticated User." + } + } + } +} diff --git a/plugins/openapi/vercel.go b/plugins/openapi/vercel.go new file mode 100644 index 0000000..3bf9ce9 --- /dev/null +++ b/plugins/openapi/vercel.go @@ -0,0 +1,59 @@ +package openapi + +import ( + "regexp" + + "github.com/patch-it-dev/patch-it-plugins/diff" +) + +// vercelDiff is how Vercel's spec says what it says: +// +// - Most deprecations are in the summary, not the flag. Of the 22 operations +// deprecated between 2024-11 and 2026-11 in vercel/sdk's spec history, 16 +// said so only in words: "Check the price for a domain (deprecated)", +// "Deprecated: Use DELETE /v1/drives/:name. ...". +// - Renaming a path parameter isn't a change for callers, and Vercel does it: +// DELETE /v2/sandboxes/drives/{name} became .../{nameOrId} in v1.28.65. +var vercelDiff = diff.Options{PathTemplates: true, DeprecatedSummary: vercelDeprecatedSummary} + +// vercelDeprecatedWords are the two ways every word-only deprecation in the +// history is written: a summary that starts "Deprecated:" or ends +// "(deprecated)". Not "deprecat" anywhere, nor a bare leading "Deprecated", +// which would match an operation about deprecated things ("Deprecated +// runtimes for a project"). +var vercelDeprecatedWords = regexp.MustCompile(`(?i)^deprecated:|\(deprecated\)\s*$`) + +func vercelDeprecatedSummary(summary string) bool { + return vercelDeprecatedWords.MatchString(summary) +} + +// vercelKeep keeps operation deprecations, and removals of operations the old +// spec had marked deprecated. Everything else is dropped, because in +// vercel/sdk's spec history (207 releases, 2024-11 to 2026-11) it was mostly +// not a change to the API: +// +// - 108 operations left the spec, and only 5 had been marked deprecated: the +// four Legacy Domains endpoints, which Vercel did shut down on 2025-11-09 +// (they now answer "This endpoint has been sunsetted"), and the drives +// rename PathTemplates already pairs up. Of the other 103, 16 came back in +// a later release, and the edge-config ones were the product's rename to +// Global Config. +// - The response side reported 67,048 removed properties, about a thousand a +// release, from the generated schemas reshuffling. +// - The request side reported 478 breaking property changes, most of them +// union members compared by position as their order moved; outside unions +// there were still 142, and 27 of those reverted later. +// +// Additions are dropped too: nobody has to fix code for a new endpoint, and a +// re-added one isn't new. +func vercelKeep(c diff.Change) bool { + switch c.Kind { + case diff.OperationDeprecated: + return true + case diff.OperationRemoved: + op, _ := c.Node.(map[string]any) + return vercelDiff.OperationDeprecated(op) + default: + return false + } +} diff --git a/plugins/openapi/vercel_test.go b/plugins/openapi/vercel_test.go new file mode 100644 index 0000000..6d0ebed --- /dev/null +++ b/plugins/openapi/vercel_test.go @@ -0,0 +1,267 @@ +package openapi + +import ( + "context" + "encoding/json" + "fmt" + "os" + "strconv" + "strings" + "testing" + "time" + + "github.com/patch-it-dev/patch-it-plugins/adapter" + "github.com/patch-it-dev/patch-it-plugins/event" + "github.com/patch-it-dev/patch-it-plugins/kit/kittest" + "github.com/patch-it-dev/patch-it-plugins/plugin" +) + +// fakeVercelAdapter serves the trimmed, unedited excerpts of vercel/sdk's +// vercel-spec.json saved under testdata/ (checked 2026-11-18), cited by the +// real URL each one was copied from, the way adapter.Vercel.Fetch cites it. +type fakeVercelAdapter struct{ latest string } + +func (fakeVercelAdapter) API() string { return "vercel" } + +func (f fakeVercelAdapter) LatestTag(context.Context) (string, error) { return f.latest, nil } + +func (fakeVercelAdapter) Fetch(_ context.Context, tag string) (adapter.Spec, error) { + body, err := os.ReadFile(vercelFile(tag)) + if err != nil { + return adapter.Spec{}, fmt.Errorf("no saved copy for tag %s: %w", tag, err) + } + return adapter.Spec{ + Content: body, + Version: strings.TrimPrefix(tag, "v"), + SourceURL: vercelURL(tag), + }, nil +} + +func vercelFile(tag string) string { return "testdata/vercel-" + tag + ".json" } + +func vercelURL(tag string) string { + return "https://raw.githubusercontent.com/vercel/sdk/" + tag + "/vercel-spec.json" +} + +// vercelPlugin is the plugin exactly as registered, over the saved copies. +func vercelPlugin(latest string) Plugin { + return Plugin{Adapter: fakeVercelAdapter{latest: latest}, Diff: vercelDiff, Keep: vercelKeep} +} + +func vercelEnv(s *kittest.Mem) plugin.Env { + return plugin.Env{Baselines: s, Now: func() time.Time { return kittest.Clock }} +} + +// The golden test: the whole life of Vercel's Legacy Domains API in its own +// spec. v1.13.5 (2025-10-08) marked four operations deprecated in their +// summaries, the day Vercel announced the Domains Registrar API: "The Legacy +// Domains API is now deprecated. ... Sunset date: 2025-11-09." +// (vercel.com/changelog/new-domains-registrar-api-for-domain-search-pricing-purchase-and-management). +// v1.18.7 (2026-01-09) removed two of them; both now answer "This endpoint has +// been sunsetted on November 9, 2025." The second pair is the replay fixture: +// one real historical breaking change. The same release added the five +// /v1/connect/networks operations, which the filter drops, saved here as one. +func TestVercelGolden(t *testing.T) { + ctx := context.Background() + s := openStore(t) + env := vercelEnv(s) + + // Daily ingest: v1.13.4 is the baseline, v1.13.5 the next day's release. + for _, tag := range []string{"v1.13.4", "v1.13.5"} { + if rejected, err := kittest.Run(ctx, env, s, vercelPlugin(tag)); err != nil || rejected { + t.Fatalf("run %s: rejected=%v err=%v", tag, rejected, err) + } + } + // The removal, replayed. + if rejected, err := kittest.Replay(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil || rejected { + t.Fatalf("replay: rejected=%v err=%v", rejected, err) + } + + events := kittest.Stored(t, s) + got := map[string]string{} + for _, e := range events { + got[e.Subject.Operation+" "+e.Version] = string(e.ChangeType) + } + want := map[string]string{ + "POST /v5/domains/buy 1.13.5": "deprecation", + "GET /v1/domains/{domain}/registry 1.13.5": "deprecation", + "GET /v4/domains/status 1.13.5": "deprecation", + "GET /v4/domains/price 1.13.5": "deprecation", + "GET /v4/domains/status 1.18.7": "breaking", + "GET /v4/domains/price 1.18.7": "breaking", + } + if len(got) != len(want) || len(events) != len(want) { + t.Fatalf("stored %v, want exactly %v", got, want) + } + for k, v := range want { + if got[k] != v { + t.Errorf("%s: got %q, want %q", k, got[k], v) + } + } + + // Acceptance criteria: every event carries its source URL and an exact + // excerpt of it, the node its pointer names in the saved copy. + for _, e := range events { + tag := "v" + e.Version + if e.ChangeType == event.ChangeTypeBreaking { + tag = "v" + e.PreviousVersion // a removal is evidenced by the old spec + } + if e.SourceURL != vercelURL(tag) { + t.Errorf("%s: source_url %s, want %s", e.Description, e.SourceURL, vercelURL(tag)) + } + if node := jsonNode(t, vercelFile(tag), e.SourcePointer); node != e.SourceExcerpt && !truncated(e.SourceExcerpt, node) { + t.Errorf("%s: excerpt %.120s…, but %s#%s holds %.120s…", e.Description, e.SourceExcerpt, tag, e.SourcePointer, node) + } + } + + kittest.Golden(t, "testdata/golden/vercel.json", events) + + // Replaying the same pair again must not duplicate the events. + if _, err := kittest.Replay(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil { + t.Fatalf("second replay: %v", err) + } + if again := kittest.Stored(t, s); len(again) != len(events) { + t.Errorf("repeating the replay added events: %d -> %d", len(events), len(again)) + } +} + +// A deprecation said only in words is evidenced by the words: the summary. +func TestVercelSummaryDeprecationQuotesTheSummary(t *testing.T) { + ctx := context.Background() + s := openStore(t) + if _, err := kittest.Replay(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.13.4", "v1.13.5"); err != nil { + t.Fatal(err) + } + for _, e := range kittest.Stored(t, s) { + if e.Subject.Operation == "GET /v4/domains/price" { + if e.SourcePointer != "/paths/~1v4~1domains~1price/get/summary" || + e.SourceExcerpt != `"Check the price for a domain (deprecated)"` { + t.Errorf("cited %s: %s", e.SourcePointer, e.SourceExcerpt) + } + return + } + } + t.Error("no deprecation event for GET /v4/domains/price") +} + +// The pinned drop test. v1.6.3 (2025-04-17) dropped five operations from the +// spec without marking them deprecated: /v1/log-drains (three operations) and +// two /v1/integrations endpoints. All five came back unchanged in name: +// /v1/log-drains in v1.15.0 (2025-10-23), the other two in v1.18.6 +// (2026-01-06). The same release reshuffled the AuthUser response schema. +// Nothing here is a change a caller had to fix. +func TestVercelDropsRemovalsThatWerentDeprecated(t *testing.T) { + ctx := context.Background() + s := openStore(t) + if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.6.2", "v1.6.3"); err != nil || rejected { + t.Fatalf("replay: rejected=%v err=%v", rejected, err) + } + if events := kittest.Stored(t, s); len(events) != 0 { + for _, e := range events { + t.Logf("got: %s", e.Description) + } + t.Fatalf("stored %d events, want none", len(events)) + } + + // Without the filter, the same pair reports the removals: the fixture still + // shows what vercelKeep is for. + s = openStore(t) + p := vercelPlugin("") + p.Keep = nil + if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "v1.6.2", "v1.6.3"); err != nil { + t.Fatal(err) + } + var removals int + for _, e := range kittest.Stored(t, s) { + if strings.HasPrefix(e.Subject.Operation, "GET /v1/log-drains") && e.ChangeType == event.ChangeTypeBreaking { + removals++ + } + } + if removals == 0 { + t.Error("unfiltered replay removes no /v1/log-drains operation; the fixture no longer shows the noise") + } +} + +// v1.28.65 (2026-11-17) renamed the path parameter of two DELETEs, {name} to +// {nameOrId}: /v1/drives/... and /v2/sandboxes/drives/..., the second marked +// deprecated. Callers send the same URL as before, so neither is removed. +func TestVercelPathParameterRenameIsNoChange(t *testing.T) { + ctx := context.Background() + s := openStore(t) + if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.28.64", "v1.28.65"); err != nil || rejected { + t.Fatalf("replay: rejected=%v err=%v", rejected, err) + } + if events := kittest.Stored(t, s); len(events) != 0 { + for _, e := range events { + t.Logf("got: %s", e.Description) + } + t.Fatalf("stored %d events, want none", len(events)) + } + + // Matching by exact path instead, the deprecated one reads as removed. + s = openStore(t) + p := vercelPlugin("") + p.Diff.PathTemplates = false + if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "v1.28.64", "v1.28.65"); err != nil { + t.Fatal(err) + } + events := kittest.Stored(t, s) + if len(events) != 1 || events[0].Subject.Operation != "DELETE /v2/sandboxes/drives/{name}" { + t.Errorf("by exact path got %d events, want the one false removal of DELETE /v2/sandboxes/drives/{name}", len(events)) + } +} + +func TestVercelDeprecatedSummary(t *testing.T) { + for summary, want := range map[string]bool{ + // Every word-only deprecation form in vercel/sdk's history. + "Check the price for a domain (deprecated)": true, + "Retrieves a list of all the Log Drains (deprecated)": true, + "Deprecated: Use DELETE /v1/drives/:name. Requires ...": true, + "Deprecated: true. Update Resource Secrets (Deprecated)": true, + "Get a list of deprecated Node.js versions": false, + "Undeprecated thing": false, + "Deprecated runtimes for a project": false, + "Update a project (deprecated fields are ignored)": false, + "": false, + } { + if got := vercelDeprecatedSummary(summary); got != want { + t.Errorf("%q: got %v, want %v", summary, got, want) + } + } +} + +// jsonNode resolves an RFC 6901 pointer in a JSON file and serializes the node +// the way normalize serializes excerpts. +func jsonNode(t *testing.T, file, pointer string) string { + t.Helper() + var node any + if err := json.Unmarshal(kittest.Read(t, file), &node); err != nil { + t.Fatal(err) + } + for _, tok := range strings.Split(strings.TrimPrefix(pointer, "/"), "/") { + tok = strings.NewReplacer("~1", "/", "~0", "~").Replace(tok) + switch n := node.(type) { + case map[string]any: + node = n[tok] + case []any: + i, err := strconv.Atoi(tok) + if err != nil || i >= len(n) { + return "" + } + node = n[i] + default: + return "" + } + } + b, err := json.Marshal(node) + if err != nil { + t.Fatal(err) + } + return string(b) +} + +// truncated reports whether excerpt is node cut to the contract's limit. +func truncated(excerpt, node string) bool { + prefix, ok := strings.CutSuffix(excerpt, "…") + return ok && strings.HasPrefix(node, prefix) +} diff --git a/providers/README.md b/providers/README.md index 7baeb09..fbf5d4a 100644 --- a/providers/README.md +++ b/providers/README.md @@ -14,6 +14,7 @@ One page per plugin id: `providers/.md`. Start from [`_template.md`](_templ | [datadog.md](datadog.md) | `datadog` | `openapi` | | [github.md](github.md) | `github` | `openapi` | | [gitlab.md](gitlab.md) | `gitlab` | `openapi` | +| [vercel.md](vercel.md) | `vercel` | `openapi` | | [openai-models.md](openai-models.md) | `openai-models` | `retirements` | | [anthropic-models.md](anthropic-models.md) | `anthropic-models` | `retirements` | | [anthropic.md](anthropic.md) | `anthropic` | `migrationguide` | diff --git a/providers/vercel.md b/providers/vercel.md new file mode 100644 index 0000000..bdf23ce --- /dev/null +++ b/providers/vercel.md @@ -0,0 +1,50 @@ +# Vercel (`vercel`) + +## What it watches + +Vercel's REST API, release by release: operations Vercel marks deprecated, and deprecated operations it then removes, between two versions of the OpenAPI spec Vercel generates its official SDK (`@vercel/sdk`) from. + +Format plugin: `openapi` (`plugins/openapi`), with `adapter.Vercel`. + +## Why this source + +- **Source:** `vercel-spec.json` in [vercel/sdk](https://github.com/vercel/sdk), pinned to a release tag (`https://raw.githubusercontent.com/vercel/sdk//vercel-spec.json`), with the newest tag taken from the GitHub Releases API. Checked on 2026-11-18. +- **Why this one:** it's Vercel's own machine-readable description of the API, committed with every SDK release (207 releases from 2024-11-25 to 2026-11-17, nearly one a day). A pinned tag can be cited and replayed. +- **Alternatives considered:** + - [`https://openapi.vercel.sh/`](https://openapi.vercel.sh/) is the same spec served live, at most a release ahead (3 more paths out of 356 on 2026-11-18), but it has no versions to pin, cite or replay. + - The [changelog](https://vercel.com/changelog), also published as Atom at `https://vercel.com/atom`, mixes product news and blog posts. It has no categories and holds only the latest 100 entries, about three weeks. + - There's no central deprecations page (`https://vercel.com/docs/deprecations` is a 404). Deprecations are scattered across changelog posts and per-product docs. + - `@vercel/sdk`'s generated commit notes flag "Breaking ⚠️" on harmless response enum additions. + - The Python SDK ([vercel/vercel-py](https://github.com/vercel/vercel-py), `vercel` on PyPI, 0.13.0) is hand-written helpers, not a client of this spec. +- **Quote:** "Check the price for a domain (deprecated)" (the summary of `GET /v4/domains/price` from v1.13.5). The same day, Vercel's changelog said "The Legacy Domains API is now deprecated. … Sunset date: 2025-11-09." ([changelog](https://vercel.com/changelog/new-domains-registrar-api-for-domain-search-pricing-purchase-and-management)). + +## How the provider announces changes + +- There's no API-wide version. Each endpoint carries its own in the path (`/v13/deployments`, `/v6/user/tokens`), and older versions usually keep working beside newer ones. `info.version` is a fixed `0.0.1`, so the event's `version` is the SDK release tag (`1.18.7`), which is also what a repo pins in `package.json`. +- Deprecations are mostly said in words. Of the 22 operations deprecated over two years, 16 had no `deprecated` flag, only a summary ending "(deprecated)" or starting "Deprecated:". +- A sunset is announced in the changelog with a date, roughly a month ahead for the Legacy Domains API. After the date, the endpoint answers with an error ("This endpoint has been sunsetted on November 9, 2025"). The operation left the spec later, between one and two months after the sunset. + +## What the plugin reads and ignores + +- **Reads:** the spec at the newest tag, diffed against the last one. Two events come out of it: + - **Deprecations:** an operation that gains the `deprecated` flag, or a summary that starts "Deprecated" or ends "(deprecated)". The event cites the flag or the summary. + - **Removals (breaking):** an operation that leaves the spec after the previous spec had marked it deprecated. +- **Matches operations by path template:** `DELETE /v2/sandboxes/drives/{name}` and `.../{nameOrId}` are one operation, because a caller sends the same URL to both (renamed in v1.28.65). +- **Ignores everything else**, because in the spec's history it was mostly not a change to the API: + - **Unmarked removals.** 103 operations left the spec without being deprecated first. 16 came back in a later release (`/v1/log-drains`, `/v1/integrations/git-namespaces`), and the `/v1/edge-config` ones were the product's [rename to Global Config](https://vercel.com/changelog/edge-config-is-now-global-config). + - **Response properties.** 67,048 response-property removals in two years, about a thousand a release, from generated schemas reshuffling. + - **Request properties.** 478 breaking request-property changes, most of them union members compared by position as their order moved. Outside unions there were 142, and 27 of those reverted later. + - **New operations.** Nobody has to fix code for a new endpoint. +- Over the 207 releases, this keeps 26 events: 22 deprecations, and the removal of the four Legacy Domains operations, all four of which Vercel shut down. +- **Replays** a historical pair (`Replay`, from `v1.18.6` to `v1.18.7`) and recreates the removal of `GET /v4/domains/price` and `GET /v4/domains/status`. The golden test also runs the deprecation of all four operations (`v1.13.4` to `v1.13.5`). The drop tests replay an unmarked removal (`v1.6.2` to `v1.6.3`) and the path-parameter rename (`v1.28.64` to `v1.28.65`). + +## Known gaps + +- Request and response property changes aren't events, even the ones that match an announced change. For example, `secret` left the `type` values of `POST /v10/projects/{idOrName}/env` in 2026-04, after Vercel [sunset legacy secrets](https://vercel.com/changelog/legacy-environment-variable-secrets-are-being-sunset), and it isn't reported. Telling those apart from the spec's churn needs a better union comparison first. +- An operation Vercel removes without marking it deprecated first isn't reported. +- A deprecation or sunset announced only in the changelog, with no spec change, isn't an event. +- Runtime deprecations (Node.js 20 on 2026-10-01, the legacy build image) are announced only in the changelog. They'd be `ci_runtime` events from a separate plugin. +- The removal event arrives after the endpoint has stopped working, because the spec drops it late. The deprecation event before it is the timely one. +- **Client:** the events are `api_operation`, the same kind as Stripe's, so the patch-it client's existing handler takes them, with no new fix kind. Two things are still open on the client side: + - Its version gate has no entry for Vercel, whose SDK (`@vercel/sdk`) is on npm. + - A sunset breaks every caller of the endpoint, whatever their SDK version, including code that calls the REST API directly. From 662641809515f307d403b63a2234799e623cc677 Mon Sep 17 00:00:00 2001 From: brandonphelps1212 Date: Thu, 19 Nov 2026 10:39:58 -0500 Subject: [PATCH 2/2] say what the vercel plugin's deprecation and removal rules match Co-Authored-By: Claude Opus 5.5 Signed-off-by: brandonphelps1212 --- providers/vercel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/vercel.md b/providers/vercel.md index bdf23ce..fb6e034 100644 --- a/providers/vercel.md +++ b/providers/vercel.md @@ -27,8 +27,8 @@ Format plugin: `openapi` (`plugins/openapi`), with `adapter.Vercel`. ## What the plugin reads and ignores - **Reads:** the spec at the newest tag, diffed against the last one. Two events come out of it: - - **Deprecations:** an operation that gains the `deprecated` flag, or a summary that starts "Deprecated" or ends "(deprecated)". The event cites the flag or the summary. - - **Removals (breaking):** an operation that leaves the spec after the previous spec had marked it deprecated. + - **Deprecations:** an operation that gains the `deprecated` flag, or a summary that starts "Deprecated:" (with the colon) or ends "(deprecated)". A bare leading "Deprecated" doesn't count, because it would match an operation about deprecated things, such as "Deprecated runtimes for a project". The event cites the flag or the summary. + - **Removals (breaking):** an operation that leaves the spec after the previous spec had marked it deprecated. "Removed" means removed from the spec, which isn't always the endpoint shutting down. All four in the history were real sunsets, but a deprecated operation could also leave the spec for a newer path version while its old URL keeps answering for a while. - **Matches operations by path template:** `DELETE /v2/sandboxes/drives/{name}` and `.../{nameOrId}` are one operation, because a caller sends the same URL to both (renamed in v1.28.65). - **Ignores everything else**, because in the spec's history it was mostly not a change to the API: - **Unmarked removals.** 103 operations left the spec without being deprecated first. 16 came back in a later release (`/v1/log-drains`, `/v1/integrations/git-namespaces`), and the `/v1/edge-config` ones were the product's [rename to Global Config](https://vercel.com/changelog/edge-config-is-now-global-config).