Skip to content

Commit c83b915

Browse files
authored
Remove legacy spec loading strategy and obsolete spec files (#1417)
- Remove getTemplateData() legacy functions from gen_events_list.go and gen_resources_cmds.go - Rename getTemplateDataFromUnifiedSpec to getTemplateData - Delete obsolete spec files: spec3.sdk.json, spec3.v2.sdk.json, spec3.v2.sdk.preview.json - Delete ZOOLANDER_SHA and sync-openapi-v2.sh script - Remove update-openapi-spec and resource Makefile targets - Update spec_test.go to use spec3.cli.json - Update ARCHITECTURE.md documentation Committed-By-Agent: cursor
1 parent 01419ae commit c83b915

File tree

11 files changed

+8
-277378
lines changed

11 files changed

+8
-277378
lines changed

ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The CLI uses the [Cobra library](https://github.com/spf13/cobra) for command str
1414

1515
In addition to the handwritten commands, the CLI also has many auto-generated resources that correspond to base [API resources](https://stripe.com/docs/api/charges). These commands are registered in `pkg/cmd/resources_cmds.go`, calling the generic `NewNamespaceCmd` function for each resource. These auto-generated commands hold no functionality on their own and mostly rely on [operation commands](#operation-commands) to do anything (see below).
1616

17-
The big list of commands found in `resources_cmds.go` is _itself_ an auto-generated file. It's built by running `pkg/gen/gen_resource_cmds.go`, which gets a big list of resources from OpenAPI via `api/openapi-spec/spec3.sdk.json` and generates the big command file via the `pkg/gen/resources_cmds.go.tpl` template. Generated commands can be manually overridden, as we do with `pkg/cmd/resource/events.go` taking precedence over the generated `events` command.
17+
The big list of commands found in `resources_cmds.go` is _itself_ an auto-generated file. It's built by running `pkg/gen/gen_resource_cmds.go`, which gets a big list of resources from OpenAPI via `api/openapi-spec/spec3.cli.json` and generates the big command file via the `pkg/gen/resources_cmds.go.tpl` template. Generated commands can be manually overridden, as we do with `pkg/cmd/resource/events.go` taking precedence over the generated `events` command.
1818

1919
### Operation Commands
2020

Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ todo:
9191
-nRo -E ' TODO:.*|SkipNow' .
9292
.PHONY: todo
9393

94-
# Updates the OpenAPI spec
95-
update-openapi-spec:
96-
rm -f ./api/openapi-spec/spec3.sdk.json
97-
wget https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.sdk.json -P ./api/openapi-spec
98-
.PHONY: update-openapi-spec
99-
10094
# Releases a new version
10195
release:
10296
# This does not release anything from your local machine but creates a tag
@@ -162,9 +156,4 @@ protoc-gen-plugin:
162156
@echo "Successfully compiled proto files for plugins"
163157
.PHONY: protoc-plugin
164158

165-
resource:
166-
./scripts/sync-openapi-v2.sh
167-
@echo "✨ Successfully built Stripe CLI with latest API resources."
168-
.PHONY: resource
169-
170159
.DEFAULT_GOAL := build

api/ZOOLANDER_SHA

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)