diff --git a/.github/workflows/code-health-foascli.yml b/.github/workflows/code-health-cli.yml similarity index 62% rename from .github/workflows/code-health-foascli.yml rename to .github/workflows/code-health-cli.yml index 82ef41c77b..26770af50f 100644 --- a/.github/workflows/code-health-foascli.yml +++ b/.github/workflows/code-health-cli.yml @@ -1,17 +1,22 @@ -name: 'Code Health FoasCLI' +name: 'Code Health CLI' +# Triggered by changes to either `tools/cli/**` or `tools/foas/**`, because the +# binary depends on the library via a local `replace ../foas` directive — library +# changes can break the binary, so we re-test the binary whenever foas changes. on: push: branches: - main - paths: + paths: - 'tools/cli/**' - - '.github/workflows/code-health-foascli.yml' + - 'tools/foas/**' + - '.github/workflows/code-health-cli.yml' pull_request: branches: - main paths: - 'tools/cli/**' - - '.github/workflows/code-health-foascli.yml' + - 'tools/foas/**' + - '.github/workflows/code-health-cli.yml' workflow_dispatch: {} workflow_call: {} @@ -22,21 +27,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout CLI - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - - name: Install Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c - with: - go-version-file: 'tools/cli/go.mod' - - name: Build CLI - working-directory: tools/cli - run: make build + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/cli/go.mod' + - name: Build + working-directory: tools/cli + run: make build unit-tests: needs: build - env: - COVERAGE: coverage.out - UNIT_TAGS: unit - INTEGRATION_TAGS: integration strategy: fail-fast: false matrix: @@ -71,25 +72,6 @@ jobs: with: version: v2.10.1 working-directory: tools/cli - - name: Checkout GitHub actions - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - with: - sparse-checkout: | - .github - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: '20.x' - cache: 'npm' - - name: Download actionlint - id: get_actionlint - run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) - shell: bash - - name: Check workflow files - run: | - echo "::add-matcher::.github/actionlint-matcher.json" - ${{ steps.get_actionlint.outputs.executable }} -color - shell: bash e2e-tests: needs: build runs-on: ubuntu-latest diff --git a/.github/workflows/code-health-foas.yml b/.github/workflows/code-health-foas.yml new file mode 100644 index 0000000000..1f7897aef4 --- /dev/null +++ b/.github/workflows/code-health-foas.yml @@ -0,0 +1,69 @@ +name: 'Code Health FOAS' +on: + push: + branches: + - main + paths: + - 'tools/foas/**' + - '.github/workflows/code-health-foas.yml' + pull_request: + branches: + - main + paths: + - 'tools/foas/**' + - '.github/workflows/code-health-foas.yml' + workflow_dispatch: {} + workflow_call: {} + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/foas/go.mod' + - name: Build + working-directory: tools/foas + run: make build + unit-tests: + needs: build + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/foas/go.mod' + - name: Run unit tests + working-directory: tools/foas + run: make unit-test + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + sparse-checkout: | + .github + tools/foas + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/foas/go.mod' + cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 + - name: golangci-lint + uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee + with: + version: v2.10.1 + working-directory: tools/foas diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index e67b0cdeb8..991febe08f 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -1,7 +1,10 @@ name: 'FOASCLI New Release' run-name: 'Release ${{ inputs.version_number }} (skip tests: ${{ inputs.skip_tests }}, use existing tag: ${{ inputs.use_existing_tag}})' -# Used for creating a new release. This workflow will run qa acceptance tests, create a new tag, and generate the release with GoReleaser. +# Used for releasing the foascli binary. Creates two tags (vX.Y.Z for the binary +# release plus tools/cli/vX.Y.Z Go submodule tag), runs QA acceptance tests, and +# publishes the foascli binary with GoReleaser. Library releases are handled +# separately by release-foas.yml. on: workflow_dispatch: inputs: @@ -52,7 +55,7 @@ jobs: && !contains(needs.*.result, 'failure') && inputs.skip_tests == 'false' secrets: inherit - uses: ./.github/workflows/code-health-foascli.yml + uses: ./.github/workflows/code-health-cli.yml release: runs-on: ubuntu-latest @@ -78,7 +81,6 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOWORK: off failure-handler: name: Failure Handler diff --git a/.github/workflows/release-foas.yml b/.github/workflows/release-foas.yml new file mode 100644 index 0000000000..338ac9aaf2 --- /dev/null +++ b/.github/workflows/release-foas.yml @@ -0,0 +1,63 @@ +name: 'FOAS Library New Release' +run-name: 'Release tools/foas/${{ inputs.version_number }} (skip tests: ${{ inputs.skip_tests }}, use existing tag: ${{ inputs.use_existing_tag }})' + +# Used for releasing the tools/foas Go library module. Creates a single tag +# `tools/foas/vX.Y.Z` so external Go consumers (e.g. mcp-server in +# `mongodb-labs/oasis`) can pin the library at a stable version. No binary +# is produced — see release-cli.yml for the foascli binary release. +on: + workflow_dispatch: + inputs: + version_number: + description: 'Version number (e.g., v1.0.0, v1.0.0-pre, v1.0.0-pre1)' + required: true + skip_tests: + description: 'Set value to `true` to skip tests, default is `false`' + default: 'false' + use_existing_tag: + description: 'Set value to `true` to use an existing tag for the release process, default is `false`' + default: 'false' + +jobs: + create-tag: + runs-on: ubuntu-latest + if: >- + !cancelled() + && inputs.use_existing_tag == 'false' + steps: + - name: Validation of version format + run: | + echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$' + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Get the latest commit SHA + id: get-sha + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Create Go submodule tag for tools/foas + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 + with: + tag: tools/foas/${{ inputs.version_number }} + commit_sha: ${{ steps.get-sha.outputs.sha }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} + + run-tests: + needs: [ create-tag ] + if: >- + !cancelled() + && !contains(needs.*.result, 'failure') + && inputs.skip_tests == 'false' + secrets: inherit + uses: ./.github/workflows/code-health-foas.yml + + failure-handler: + name: Failure Handler + needs: [ run-tests ] + if: ${{ always() && contains(needs.*.result, 'failure') }} + uses: ./.github/workflows/failure-handler.yml + with: + env: "prod" + release_name: "FOAS" + team_id: ${{ vars.JIRA_TEAM_ID_APIX_PLATFORM }} + secrets: + jira_api_token: ${{ secrets.JIRA_API_TOKEN }} diff --git a/.gitignore b/.gitignore index f765072ace..4beb6a796f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,8 @@ *.dylib /tools/*/bin/* /tools/*/tmp/* -/tools/cli/test/e2e/cli/output/** -!/tools/cli/test/e2e/cli/output/.gitkeep +/tools/cli/test/e2e/cli/output/** +!/tools/cli/test/e2e/cli/output/.gitkeep /tools/*/dist/* /tools/*/output/* # We don't want to commit env variables diff --git a/tools/README.md b/tools/README.md index 1f5e6971f8..4749928d40 100644 --- a/tools/README.md +++ b/tools/README.md @@ -10,6 +10,6 @@ Includes resources and scripts to generate [MongoDB Atlas Postman Collections](h MongoDB [Spectral](https://github.com/stoplightio/spectral) OpenAPI specification validation rules for IPA-compliance. -## CLI +## FOAS -OpenAPI CLI. Internal MongoDB CLI used for OpenAPI transformations. +The OpenAPI tooling library (`tools/foas`) and its CLI binary (`tools/cli`). diff --git a/tools/cli/.goreleaser.yml b/tools/cli/.goreleaser.yml index b317c44ff3..03cb6cd5b9 100644 --- a/tools/cli/.goreleaser.yml +++ b/tools/cli/.goreleaser.yml @@ -13,7 +13,7 @@ builds: binary: bin/foascli main: ./cmd/foascli.go ldflags: - - -s -w -X github.com/mongodb/openapi/tools/cli/internal/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit={{.FullCommit}} + - -s -w -X github.com/mongodb/openapi/tools/cli/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/version.GitCommit={{.FullCommit}} id: linux goos: [linux] goarch: [amd64,arm64] diff --git a/tools/cli/Makefile b/tools/cli/Makefile index 2b6f6f9dd3..b3fcf38dd9 100644 --- a/tools/cli/Makefile +++ b/tools/cli/Makefile @@ -13,8 +13,8 @@ E2E_TIMEOUT?=60m E2E_PARALLEL?=1 E2E_EXTRA_ARGS?= -LINKER_GH_SHA_FLAG=-s -w -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit=${GIT_SHA} -LINKER_FLAGS=${LINKER_GH_SHA_FLAG} -X github.com/mongodb/openapi/tools/cli/internal/version.Version=${VERSION} +LINKER_GH_SHA_FLAG=-s -w -X github.com/mongodb/openapi/tools/cli/version.GitCommit=${GIT_SHA} +LINKER_FLAGS=${LINKER_GH_SHA_FLAG} -X github.com/mongodb/openapi/tools/cli/version.Version=${VERSION} DEBUG_FLAGS=all=-N -l TEST_CMD?=go test @@ -74,20 +74,15 @@ e2e-test: build ## Run E2E tests rm -rf test/e2e/cli/output $(TEST_CMD) -v -p 1 -parallel $(E2E_PARALLEL) -timeout $(E2E_TIMEOUT) ./test/e2e... $(E2E_EXTRA_ARGS) -.PHONY: gen-docs -gen-docs: ## Generate docs - @echo "==> Updating docs" - ./scripts/update_docs.sh - .PHONY: unit-test -unit-test: ## Run unit-tests +unit-test: ## Run unit-tests (excludes ./test/e2e — see e2e-test target) @echo "==> Running unit tests..." - $(TEST_CMD) -race -cover ./internal... + $(TEST_CMD) -race -cover $$(go list ./... | grep -v '/test/e2e') .PHONY: gen-mocks gen-mocks: ## Generate mocks @echo "==> Generating mocks" - go generate ./internal... + go generate ./... .PHONY: pre-commit pre-commit: fmt lint unit-test ## Run pre-commit checks diff --git a/tools/cli/README.md b/tools/cli/README.md index e8925feed3..3363a3c03c 100644 --- a/tools/cli/README.md +++ b/tools/cli/README.md @@ -1,39 +1,17 @@ -# FOASCLI -FOASCLI is a Go-based CLI tool that provides commands for generating the Federated OpenAPI specification and the API changelog. +# FOAS CLI -### Build From Source +Binary entrypoint for the FOAS OpenAPI tooling. Depends on the [`tools/foas`](../foas) library module. -#### Fetch Source +See [RELEASING.md](./RELEASING.md) for release instructions. -```bash -git clone https://github.com/mongodb/openapi.git -cd openapi/tools/cli -``` - -#### Build -To build `foascli`, run: +## Build ```bash -make build +make build # produces ./bin/foascli ``` -The resulting `foascli` binary is placed in `./bin`. +## Test -## Usage -To get a list of available commands, run `foascli help`. - -## Setup Environment -To set up the development environment, run: ```bash -make setup +make test ``` - -### Run tests -To run unit and e2e tests, run: -```bash -make lint && unit-test && e2e-test -``` - -## Contributing - -See our [CONTRIBUTING.md](../../CONTRIBUTING.md) guide. diff --git a/tools/cli/RELEASING.md b/tools/cli/RELEASING.md index a7d659dd94..4703abc2a6 100644 --- a/tools/cli/RELEASING.md +++ b/tools/cli/RELEASING.md @@ -10,7 +10,25 @@ - Using [GitHub CLI](https://cli.github.com/), run the command ```bash -cd tools/cli # Make sure to update version_number with the release version gh workflow run release-cli.yml -f version_number=vX.Y.Z -f skip_tests=false -f use_existing_tag=false ``` + +## What the workflow does + +1. Validates the version number format. +2. Creates two tags pointing at the release commit: + - `vX.Y.Z` — used by GoReleaser to publish the foascli binary and archives (`mongodb-foas-cli_*.tar.gz`). + - `tools/cli/vX.Y.Z` — Go submodule tag for the binary module (informational; rarely imported). +3. Runs the cli QA test suite (`code-health-cli.yml`) unless `skip_tests=true`. +4. Runs GoReleaser in `tools/cli/` to build and publish the binary archives to GitHub Releases. + +## When to bump the binary version + +Cli releases are on-demand — bump when you want users (mms, humans, anyone running `foascli`) to get accumulated changes. Triggers: + +- Any change to cli plumbing (cobra commands, flags, output formats, bug fixes). +- A library change that adds a user-facing capability now exposed by cli. +- A library bugfix that affects binary behavior. + +Don't bump the binary for library-only refactors or library changes that don't surface through cli. Those are library-only releases (see [`tools/foas/RELEASING.md`](../foas/RELEASING.md)). diff --git a/tools/cli/internal/cli/breakingchanges/breakingchanges.go b/tools/cli/breakingchanges/breakingchanges.go similarity index 91% rename from tools/cli/internal/cli/breakingchanges/breakingchanges.go rename to tools/cli/breakingchanges/breakingchanges.go index d111c4a0ba..11a2e0bad6 100644 --- a/tools/cli/internal/cli/breakingchanges/breakingchanges.go +++ b/tools/cli/breakingchanges/breakingchanges.go @@ -15,7 +15,7 @@ package breakingchanges import ( - "github.com/mongodb/openapi/tools/cli/internal/cli/breakingchanges/exemptions" + "github.com/mongodb/openapi/tools/cli/breakingchanges/exemptions" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/breakingchanges/breakingchanges_test.go b/tools/cli/breakingchanges/breakingchanges_test.go similarity index 93% rename from tools/cli/internal/cli/breakingchanges/breakingchanges_test.go rename to tools/cli/breakingchanges/breakingchanges_test.go index ba77c7f61f..575d04e11f 100644 --- a/tools/cli/internal/cli/breakingchanges/breakingchanges_test.go +++ b/tools/cli/breakingchanges/breakingchanges_test.go @@ -17,7 +17,7 @@ package breakingchanges import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/internal/cli/breakingchanges/exemptions/exemptions.go b/tools/cli/breakingchanges/exemptions/exemptions.go similarity index 100% rename from tools/cli/internal/cli/breakingchanges/exemptions/exemptions.go rename to tools/cli/breakingchanges/exemptions/exemptions.go diff --git a/tools/cli/internal/cli/breakingchanges/exemptions/parse.go b/tools/cli/breakingchanges/exemptions/parse.go similarity index 92% rename from tools/cli/internal/cli/breakingchanges/exemptions/parse.go rename to tools/cli/breakingchanges/exemptions/parse.go index 19b7d98ec7..ab49cb7a46 100644 --- a/tools/cli/internal/cli/breakingchanges/exemptions/parse.go +++ b/tools/cli/breakingchanges/exemptions/parse.go @@ -17,9 +17,9 @@ package exemptions import ( "errors" - "github.com/mongodb/openapi/tools/cli/internal/breakingchanges" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/breakingchanges/exemptions/parse_test.go b/tools/cli/breakingchanges/exemptions/parse_test.go similarity index 84% rename from tools/cli/internal/cli/breakingchanges/exemptions/parse_test.go rename to tools/cli/breakingchanges/exemptions/parse_test.go index f307df5411..f841cc9960 100644 --- a/tools/cli/internal/cli/breakingchanges/exemptions/parse_test.go +++ b/tools/cli/breakingchanges/exemptions/parse_test.go @@ -10,8 +10,8 @@ import ( func TestSuccessfulParse_Run(t *testing.T) { fs := afero.NewOsFs() opts := &Opts{ - exemptionsPaths: "../../../../test/data/exemptions/valid_exemptions.yaml", - outputPath: "../../../../test/data/exemptions/exemptions.txt", + exemptionsPaths: "../../../foas/test/data/exemptions/valid_exemptions.yaml", + outputPath: "../../../foas/test/data/exemptions/exemptions.txt", fs: fs, } @@ -36,7 +36,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - exemptionsPath: "../../../../test/data/exemptions/valid_exemptions.yaml", + exemptionsPath: "../../../foas/test/data/exemptions/valid_exemptions.yaml", name: "Successful", }, { diff --git a/tools/cli/internal/cli/changelog/changelog.go b/tools/cli/changelog/changelog.go similarity index 86% rename from tools/cli/internal/cli/changelog/changelog.go rename to tools/cli/changelog/changelog.go index 02aca87809..c9c4c20c73 100644 --- a/tools/cli/internal/cli/changelog/changelog.go +++ b/tools/cli/changelog/changelog.go @@ -15,8 +15,8 @@ package changelog import ( - "github.com/mongodb/openapi/tools/cli/internal/cli/changelog/convert" - "github.com/mongodb/openapi/tools/cli/internal/cli/changelog/metadata" + "github.com/mongodb/openapi/tools/cli/changelog/convert" + "github.com/mongodb/openapi/tools/cli/changelog/metadata" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/changelog_test.go b/tools/cli/changelog/changelog_test.go similarity index 93% rename from tools/cli/internal/cli/changelog/changelog_test.go rename to tools/cli/changelog/changelog_test.go index ef23dec0cd..f44d148b19 100644 --- a/tools/cli/internal/cli/changelog/changelog_test.go +++ b/tools/cli/changelog/changelog_test.go @@ -17,7 +17,7 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/internal/cli/changelog/convert/convert.go b/tools/cli/changelog/convert/convert.go similarity index 100% rename from tools/cli/internal/cli/changelog/convert/convert.go rename to tools/cli/changelog/convert/convert.go diff --git a/tools/cli/internal/cli/changelog/convert/slack.go b/tools/cli/changelog/convert/slack.go similarity index 97% rename from tools/cli/internal/cli/changelog/convert/slack.go rename to tools/cli/changelog/convert/slack.go index 5e40255b3b..79c3e0c33b 100644 --- a/tools/cli/internal/cli/changelog/convert/slack.go +++ b/tools/cli/changelog/convert/slack.go @@ -20,9 +20,9 @@ import ( "sort" "strconv" - "github.com/mongodb/openapi/tools/cli/internal/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/changelog" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/convert/slack_test.go b/tools/cli/changelog/convert/slack_test.go similarity index 100% rename from tools/cli/internal/cli/changelog/convert/slack_test.go rename to tools/cli/changelog/convert/slack_test.go diff --git a/tools/cli/internal/cli/changelog/create.go b/tools/cli/changelog/create.go similarity index 95% rename from tools/cli/internal/cli/changelog/create.go rename to tools/cli/changelog/create.go index 495cfffbff..059de83ca2 100644 --- a/tools/cli/internal/cli/changelog/create.go +++ b/tools/cli/changelog/create.go @@ -19,10 +19,10 @@ import ( "log" "time" - "github.com/mongodb/openapi/tools/cli/internal/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/changelog" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/create_test.go b/tools/cli/changelog/create_test.go similarity index 87% rename from tools/cli/internal/cli/changelog/create_test.go rename to tools/cli/changelog/create_test.go index c22640a32a..839eab24c6 100644 --- a/tools/cli/internal/cli/changelog/create_test.go +++ b/tools/cli/changelog/create_test.go @@ -17,8 +17,8 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/test" ) func TestCreateBuilder(t *testing.T) { diff --git a/tools/cli/internal/cli/changelog/metadata/create.go b/tools/cli/changelog/metadata/create.go similarity index 91% rename from tools/cli/internal/cli/changelog/metadata/create.go rename to tools/cli/changelog/metadata/create.go index 7d9d292899..dfe5906efb 100644 --- a/tools/cli/internal/cli/changelog/metadata/create.go +++ b/tools/cli/changelog/metadata/create.go @@ -19,11 +19,11 @@ import ( "fmt" "time" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/changelog" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/metadata/create_test.go b/tools/cli/changelog/metadata/create_test.go similarity index 93% rename from tools/cli/internal/cli/changelog/metadata/create_test.go rename to tools/cli/changelog/metadata/create_test.go index 5d7338361f..726db5bcbb 100644 --- a/tools/cli/internal/cli/changelog/metadata/create_test.go +++ b/tools/cli/changelog/metadata/create_test.go @@ -17,8 +17,8 @@ package metadata import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/test" "github.com/spf13/afero" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/cli/changelog/metadata/metadata.go b/tools/cli/changelog/metadata/metadata.go similarity index 100% rename from tools/cli/internal/cli/changelog/metadata/metadata.go rename to tools/cli/changelog/metadata/metadata.go diff --git a/tools/cli/internal/cli/changelog/metadata/metadata_test.go b/tools/cli/changelog/metadata/metadata_test.go similarity index 93% rename from tools/cli/internal/cli/changelog/metadata/metadata_test.go rename to tools/cli/changelog/metadata/metadata_test.go index f034759eb3..fa237ce4be 100644 --- a/tools/cli/internal/cli/changelog/metadata/metadata_test.go +++ b/tools/cli/changelog/metadata/metadata_test.go @@ -17,7 +17,7 @@ package metadata import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/cmd/foascli.go b/tools/cli/cmd/foascli.go index f1ef39c0d7..c5c65b193e 100644 --- a/tools/cli/cmd/foascli.go +++ b/tools/cli/cmd/foascli.go @@ -18,7 +18,7 @@ import ( "context" "os" - "github.com/mongodb/openapi/tools/cli/internal/cli/root/openapi" + "github.com/mongodb/openapi/tools/cli/root/openapi" ) // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/tools/cli/internal/cli/filter/filter.go b/tools/cli/filter/filter.go similarity index 93% rename from tools/cli/internal/cli/filter/filter.go rename to tools/cli/filter/filter.go index 1993a486f3..0094e32c0c 100644 --- a/tools/cli/internal/cli/filter/filter.go +++ b/tools/cli/filter/filter.go @@ -19,11 +19,11 @@ import ( "log" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/filter" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/filter" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/filter/filter_test.go b/tools/cli/filter/filter_test.go similarity index 95% rename from tools/cli/internal/cli/filter/filter_test.go rename to tools/cli/filter/filter_test.go index 0f4235f374..46ff21ccd9 100644 --- a/tools/cli/internal/cli/filter/filter_test.go +++ b/tools/cli/filter/filter_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/load" "github.com/spf13/afero" "github.com/stretchr/testify/require" @@ -30,7 +30,7 @@ func TestSuccessfulFilter_Run(t *testing.T) { t.Parallel() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "filtered-oas.yaml", fs: fs, env: "dev", @@ -57,7 +57,7 @@ func TestSuccessfulFilterWithVersion_Run(t *testing.T) { t.Parallel() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "filtered-oas.yaml", fs: fs, env: "dev", @@ -81,7 +81,7 @@ func TestSuccessfulFilterWithMultipleVersions_Run(t *testing.T) { t.Parallel() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "filtered-oas.yaml", fs: fs, env: "dev", @@ -155,7 +155,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", name: "Successful", }, } diff --git a/tools/cli/internal/cli/flag/flag.go b/tools/cli/flag/flag.go similarity index 100% rename from tools/cli/internal/cli/flag/flag.go rename to tools/cli/flag/flag.go diff --git a/tools/cli/go.mod b/tools/cli/go.mod index 3663b459f5..de3f026d39 100644 --- a/tools/cli/go.mod +++ b/tools/cli/go.mod @@ -2,17 +2,14 @@ module github.com/mongodb/openapi/tools/cli go 1.26 -toolchain go1.26.0 - require ( github.com/getkin/kin-openapi v0.139.0 - github.com/iancoleman/strcase v0.3.0 + github.com/mongodb/openapi/tools/foas v0.0.0 github.com/oasdiff/oasdiff v1.16.0 github.com/spf13/afero v1.15.0 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 go.uber.org/mock v0.6.0 - golang.org/x/text v0.37.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -22,9 +19,10 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/go-openapi/jsonpointer v0.22.5 // indirect github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mailru/easyjson v0.9.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/oasdiff/yaml v0.1.0 // indirect @@ -42,5 +40,7 @@ require ( github.com/yargevad/filepathx v1.0.0 // indirect github.com/yuin/goldmark v1.8.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + golang.org/x/text v0.37.0 // indirect ) + +replace github.com/mongodb/openapi/tools/foas => ../foas diff --git a/tools/cli/go.sum b/tools/cli/go.sum index f6453cfcc6..5842f3dfb6 100644 --- a/tools/cli/go.sum +++ b/tools/cli/go.sum @@ -26,11 +26,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= @@ -45,10 +42,8 @@ github.com/oasdiff/yaml3 v0.0.13 h1:06svmvOHOVBqF81+sY2EUScvUI/iS/vl2VIeUUxZQwg= github.com/oasdiff/yaml3 v0.0.13/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/tools/cli/internal/openapi/filter/README.md b/tools/cli/internal/openapi/filter/README.md deleted file mode 100644 index 4192c10526..0000000000 --- a/tools/cli/internal/openapi/filter/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# List of filters applied to the OpenAPI specification -These examples are automatically generated from filters docs. -# OpenAPI Filters -## Why filtering OpenAPI? -The Atlas Admin API OpenAPI specifications are used not only to document REST endpoints, but also to capture extra functionality such as Versioning information, team ownership, and more. This extra information is used to then correctly generate the OpenAPI respective to each version of the API. -## What is the general filter purpose? - - Filtering per environment, so that only the endpoints that are available in that environment are shown. - - Filtering per version, so that only the endpoints that are available in that version are shown. -## What filters are available? -### List of filters -[ExtensionFilter: is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec (unless keepIPAExceptions is set in metadata).](../internal/openapi/filter/extension.go?plain=1#L21) -[HiddenEnvsFilter: is a filter that removes paths, operations,](../internal/openapi/filter/hidden_envs.go?plain=1#L28) -[InfoVersioningFilter: Filter that modifies the Info object in the OpenAPI spec with the target version.](../internal/openapi/filter/info.go?plain=1#L23) -[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.](../internal/openapi/filter/operations.go?plain=1#L20) -[TagsFilter: removes tags that are not used in the operations.](../internal/openapi/filter/tags.go?plain=1#L23) -[VersioningExtensionFilter: is a filter that updates the x-sunset and x-xgen-version extensions to a date string](../internal/openapi/filter/versioning_extension.go?plain=1#L25) -[VersioningFilter: is a filter that modifies the OpenAPI spec by removing operations and responses](../internal/openapi/filter/versioning.go?plain=1#L25) diff --git a/tools/cli/internal/cli/merge/merge.go b/tools/cli/merge/merge.go similarity index 94% rename from tools/cli/internal/cli/merge/merge.go rename to tools/cli/merge/merge.go index af57072216..d2d17a19f3 100644 --- a/tools/cli/internal/cli/merge/merge.go +++ b/tools/cli/merge/merge.go @@ -18,9 +18,9 @@ import ( "encoding/json" "fmt" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/merge/merge_test.go b/tools/cli/merge/merge_test.go similarity index 95% rename from tools/cli/internal/cli/merge/merge_test.go rename to tools/cli/merge/merge_test.go index d94f63e11c..0bdcc13e35 100644 --- a/tools/cli/internal/cli/merge/merge_test.go +++ b/tools/cli/merge/merge_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" @@ -121,7 +121,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", name: "Successful", externalPaths: []string{"test"}, }, diff --git a/tools/cli/pkg/apiversion/apiversion.go b/tools/cli/pkg/apiversion/apiversion.go deleted file mode 100644 index 9478a22a64..0000000000 --- a/tools/cli/pkg/apiversion/apiversion.go +++ /dev/null @@ -1,23 +0,0 @@ -// Package apiversion exposes API version parsing utilities for use outside the cli module. -package apiversion - -import ( - "github.com/mongodb/openapi/tools/cli/internal/apiversion" -) - -// Parse extracts the API version string from a versioned media type -// (e.g. "application/vnd.atlas.2024-01-01+json" → "2024-01-01"). -// Returns an error if the media type does not match the expected pattern. -func Parse(contentType string) (string, error) { - return apiversion.Parse(contentType) -} - -// IsPreviewStabilityLevel reports whether the given version string represents a preview release. -func IsPreviewStabilityLevel(version string) bool { - return apiversion.IsPreviewStabilityLevel(version) -} - -// IsUpcomingStabilityLevel reports whether the given version string represents an upcoming release. -func IsUpcomingStabilityLevel(version string) bool { - return apiversion.IsUpcomingStabilityLevel(version) -} diff --git a/tools/cli/pkg/openapi/openapi.go b/tools/cli/pkg/openapi/openapi.go deleted file mode 100644 index 4cc971fc85..0000000000 --- a/tools/cli/pkg/openapi/openapi.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 MongoDB Inc -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package openapi provides public interfaces for loading and saving OpenAPI specifications. -// This package wraps the internal openapi package to provide a stable public API. -package openapi - -import ( - "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/slice" - "github.com/oasdiff/oasdiff/load" - "github.com/spf13/afero" -) - -// ExtractVersions returns all API version strings present in the spec, -// including stable date versions (e.g. "2024-01-01"), preview names -// (e.g. "preview", "public-preview"), and upcoming versions -// (e.g. "2024-01-01.upcoming") when no stable counterpart exists. -// The returned slice is sorted. -func ExtractVersions(spec *openapi3.T) ([]string, error) { - return openapi.ExtractVersionsWithEnv(spec, "") -} - -// SliceCriteria defines the selection criteria for slicing an OpenAPI spec. -// Operations matching ANY of the specified criteria will be included (OR logic). -type SliceCriteria = slice.Criteria - -// Slice filters an OpenAPI spec to keep only operations matching the criteria. -func Slice(spec *openapi3.T, criteria *SliceCriteria) error { - return slice.Slice(spec, criteria) -} - -// Loader provides methods for loading OpenAPI specifications from files. -type Loader struct { - impl *openapi.OpenAPI3 -} - -// NewLoader creates a new OpenAPI loader. -func NewLoader() *Loader { - return &Loader{ - impl: openapi.NewOpenAPI3(), - } -} - -// LoadFromPath loads an OpenAPI spec from the given file path. -func (l *Loader) LoadFromPath(path string) (*load.SpecInfo, error) { - return l.impl.CreateOpenAPISpecFromPath(path) -} - -// SaveToFile saves an OpenAPI spec to a file in the specified format. -// Format can be "json", "yaml", or "all". -func SaveToFile(path, format string, spec *openapi3.T, fs afero.Fs) error { - return openapi.Save(path, spec, format, fs) -} diff --git a/tools/cli/precommit.sh b/tools/cli/precommit.sh index 5404f9a5bc..39d290c813 100755 --- a/tools/cli/precommit.sh +++ b/tools/cli/precommit.sh @@ -4,7 +4,7 @@ set -e # Get the root directory of the project ROOT_DIR=$(git rev-parse --show-toplevel) -pushd "$ROOT_DIR/tools/cli" +pushd "$ROOT_DIR/tools/foas" make pre-commit popd diff --git a/tools/cli/internal/cli/root/openapi/builder.go b/tools/cli/root/openapi/builder.go similarity index 76% rename from tools/cli/internal/cli/root/openapi/builder.go rename to tools/cli/root/openapi/builder.go index 6a1ed04cd6..ca1309325d 100644 --- a/tools/cli/internal/cli/root/openapi/builder.go +++ b/tools/cli/root/openapi/builder.go @@ -18,15 +18,15 @@ import ( "fmt" "runtime" - "github.com/mongodb/openapi/tools/cli/internal/cli/breakingchanges" - "github.com/mongodb/openapi/tools/cli/internal/cli/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/filter" - "github.com/mongodb/openapi/tools/cli/internal/cli/merge" - "github.com/mongodb/openapi/tools/cli/internal/cli/slice" - "github.com/mongodb/openapi/tools/cli/internal/cli/split" - "github.com/mongodb/openapi/tools/cli/internal/cli/sunset" - "github.com/mongodb/openapi/tools/cli/internal/cli/versions" - "github.com/mongodb/openapi/tools/cli/internal/version" + "github.com/mongodb/openapi/tools/cli/breakingchanges" + "github.com/mongodb/openapi/tools/cli/changelog" + "github.com/mongodb/openapi/tools/cli/filter" + "github.com/mongodb/openapi/tools/cli/merge" + "github.com/mongodb/openapi/tools/cli/slice" + "github.com/mongodb/openapi/tools/cli/split" + "github.com/mongodb/openapi/tools/cli/sunset" + "github.com/mongodb/openapi/tools/cli/version" + "github.com/mongodb/openapi/tools/cli/versions" "github.com/spf13/cobra" ) diff --git a/tools/cli/scripts/update_docs.sh b/tools/cli/scripts/update_docs.sh deleted file mode 100755 index 432f296a93..0000000000 --- a/tools/cli/scripts/update_docs.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -# Update the filters documentation -./scripts/doc_filters.sh > internal/openapi/filter/README.md - -go fmt ./... - -if [ -n "$(git status --porcelain internal/openapi/filter/README.md)" ]; then - git add "internal/openapi/filter/README.md" -fi \ No newline at end of file diff --git a/tools/cli/internal/cli/slice/slice.go b/tools/cli/slice/slice.go similarity index 94% rename from tools/cli/internal/cli/slice/slice.go rename to tools/cli/slice/slice.go index 2ec3b48190..dd202ae640 100644 --- a/tools/cli/internal/cli/slice/slice.go +++ b/tools/cli/slice/slice.go @@ -19,10 +19,10 @@ import ( "fmt" "log" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/slice" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/slice" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/slice/slice_test.go b/tools/cli/slice/slice_test.go similarity index 100% rename from tools/cli/internal/cli/slice/slice_test.go rename to tools/cli/slice/slice_test.go diff --git a/tools/cli/internal/cli/split/split.go b/tools/cli/split/split.go similarity index 93% rename from tools/cli/internal/cli/split/split.go rename to tools/cli/split/split.go index f7b30dab79..ce2ab2f0ed 100644 --- a/tools/cli/internal/cli/split/split.go +++ b/tools/cli/split/split.go @@ -20,10 +20,10 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/cli/filter" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/filter" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/split/split_test.go b/tools/cli/split/split_test.go similarity index 91% rename from tools/cli/internal/cli/split/split_test.go rename to tools/cli/split/split_test.go index 983b71e095..06221638fd 100644 --- a/tools/cli/internal/cli/split/split_test.go +++ b/tools/cli/split/split_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/load" "github.com/spf13/afero" "github.com/stretchr/testify/require" @@ -29,7 +29,7 @@ func TestSuccessfulSplit_Run(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -42,7 +42,7 @@ func TestSplitPublicPreviewRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_public_preview.json", + basePath: "../../foas/test/data/base_spec_with_public_preview.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -63,7 +63,7 @@ func TestSplitPrivatePreviewRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -84,7 +84,7 @@ func TestSplitUpcomingRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/openapi_with_upcoming.json", + basePath: "../../foas/test/data/openapi_with_upcoming.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -105,7 +105,7 @@ func TestSplitMultiplePreviewsRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_multiple_private_and_public_previews.json", + basePath: "../../foas/test/data/base_spec_with_multiple_private_and_public_previews.json", outputPath: "foas.yaml", env: "dev", fs: fs, @@ -143,7 +143,7 @@ func TestInjectSha_Run(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.yaml", fs: fs, gitSha: "123456", @@ -171,7 +171,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", name: "Successful", }, } diff --git a/tools/cli/internal/cli/sunset/diff.go b/tools/cli/sunset/diff.go similarity index 96% rename from tools/cli/internal/cli/sunset/diff.go rename to tools/cli/sunset/diff.go index f9eb49f73a..8204fb8e96 100644 --- a/tools/cli/internal/cli/sunset/diff.go +++ b/tools/cli/sunset/diff.go @@ -21,10 +21,10 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/tools/cli/internal/cli/sunset/diff_test.go b/tools/cli/sunset/diff_test.go similarity index 99% rename from tools/cli/internal/cli/sunset/diff_test.go rename to tools/cli/sunset/diff_test.go index 95b968683a..7add60410e 100644 --- a/tools/cli/internal/cli/sunset/diff_test.go +++ b/tools/cli/sunset/diff_test.go @@ -18,7 +18,7 @@ import ( "testing" "time" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/cli/sunset/list.go b/tools/cli/sunset/list.go similarity index 94% rename from tools/cli/internal/cli/sunset/list.go rename to tools/cli/sunset/list.go index fb59fb186d..5813c80e09 100644 --- a/tools/cli/internal/cli/sunset/list.go +++ b/tools/cli/sunset/list.go @@ -21,10 +21,10 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/tools/cli/internal/cli/sunset/list_test.go b/tools/cli/sunset/list_test.go similarity index 98% rename from tools/cli/internal/cli/sunset/list_test.go rename to tools/cli/sunset/list_test.go index 42fe58188f..e864af7259 100644 --- a/tools/cli/internal/cli/sunset/list_test.go +++ b/tools/cli/sunset/list_test.go @@ -19,7 +19,7 @@ import ( "reflect" "testing" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -28,7 +28,7 @@ import ( func TestList_Run(t *testing.T) { fs := afero.NewMemMapFs() opts := &ListOpts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.json", fs: fs, format: "json", diff --git a/tools/cli/internal/cli/sunset/sunset.go b/tools/cli/sunset/sunset.go similarity index 100% rename from tools/cli/internal/cli/sunset/sunset.go rename to tools/cli/sunset/sunset.go diff --git a/tools/cli/internal/cli/sunset/sunset_test.go b/tools/cli/sunset/sunset_test.go similarity index 93% rename from tools/cli/internal/cli/sunset/sunset_test.go rename to tools/cli/sunset/sunset_test.go index ad830c5adb..91c5bba4c6 100644 --- a/tools/cli/internal/cli/sunset/sunset_test.go +++ b/tools/cli/sunset/sunset_test.go @@ -17,7 +17,7 @@ package sunset import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/internal/test/test.go b/tools/cli/test/cmdvalidator.go similarity index 100% rename from tools/cli/internal/test/test.go rename to tools/cli/test/cmdvalidator.go diff --git a/tools/cli/test/e2e/cli/changelog_test.go b/tools/cli/test/e2e/cli/changelog_test.go index 4cfcfe7e18..921216b91e 100644 --- a/tools/cli/test/e2e/cli/changelog_test.go +++ b/tools/cli/test/e2e/cli/changelog_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog" + "github.com/mongodb/openapi/tools/foas/changelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/test/e2e/cli/cli.go b/tools/cli/test/e2e/cli/cli.go index 139af98bf3..4f0b3b386a 100644 --- a/tools/cli/test/e2e/cli/cli.go +++ b/tools/cli/test/e2e/cli/cli.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -27,187 +27,187 @@ func NewBin(t *testing.T) string { func NewBaseSpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/base_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/base_spec.json") require.NoError(t, err) return cliPath } func NewChangelogBasePathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/base") require.NoError(t, err) return cliPath } func NewChangelogRevisionPathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/revision") require.NoError(t, err) return cliPath } func NewChangelogExepmtionFilePathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/exemptions.yaml") require.NoError(t, err) return cliPath } func NewChangelogOutputPathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/output") require.NoError(t, err) return cliPath } func NewChangelogBasePathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/base") require.NoError(t, err) return cliPath } func NewChangelogRevisionPathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/revision") require.NoError(t, err) return cliPath } func NewChangelogExemptionFilePathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/exemptions.yaml") require.NoError(t, err) return cliPath } func NewChangelogOutputPathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/output") require.NoError(t, err) return cliPath } func newChangelogOutputPathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/output") require.NoError(t, err) return cliPath } func newChangelogOutputPathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/output") require.NoError(t, err) return cliPath } func newChangelogBasePathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/base") require.NoError(t, err) return cliPath } func newChangelogBasePathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/base") require.NoError(t, err) return cliPath } func newChangelogRevisionPathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/revision") require.NoError(t, err) return cliPath } func newChangelogRevisionPathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/revision") require.NoError(t, err) return cliPath } func newChangelogExemptionFilePathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/exemptions.yaml") require.NoError(t, err) return cliPath } func newChangelogExemptionFilePathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/exemptions.yaml") require.NoError(t, err) return cliPath } func newChangelogBasePathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/base") require.NoError(t, err) return cliPath } func newChangelogRevisionPathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/revision") require.NoError(t, err) return cliPath } func newChangelogExemptionFilePathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/exemptions.yaml") require.NoError(t, err) return cliPath } func newChangelogOutputPathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/output") require.NoError(t, err) return cliPath } func NewAPIRegistrySpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/apiregistry_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/apiregistry_spec.json") require.NoError(t, err) return cliPath } func NewAuthNSpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/authn_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/authn_spec.json") require.NoError(t, err) return cliPath } func NewDuplicatedPathAPIRegistrySpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/duplicated_path_apiregistry_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/duplicated_path_apiregistry_spec.json") require.NoError(t, err) return cliPath } func NewNotIdenticalComponentPIRegistrySpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/not_identical_component_apiregistry_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/not_identical_component_apiregistry_spec.json") require.NoError(t, err) return cliPath } func NewDuplicatedTagAuthNSpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/duplicated_tag_authn_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/duplicated_tag_authn_spec.json") require.NoError(t, err) return cliPath } func NewValidAtlasSpecPath(t *testing.T, version, folder string) string { t.Helper() - cliPath, err := filepath.Abs("../../data/split/" + folder + "/openapi-v2-" + version + ".json") + cliPath, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-v2-" + version + ".json") require.NoError(t, err) return cliPath } diff --git a/tools/cli/test/e2e/cli/parse_test.go b/tools/cli/test/e2e/cli/parse_test.go index 6be574fbf6..8a606be600 100644 --- a/tools/cli/test/e2e/cli/parse_test.go +++ b/tools/cli/test/e2e/cli/parse_test.go @@ -35,9 +35,9 @@ func TestParseCommand(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - exemptionsFilePath, err := filepath.Abs("../../data/exemptions/" + tc.exemptionsFile) + exemptionsFilePath, err := filepath.Abs("../../../../foas/test/data/exemptions/" + tc.exemptionsFile) require.NoError(t, err) - outputFilePath, err := filepath.Abs("../../data/exemptions/" + tc.expectedOutput) + outputFilePath, err := filepath.Abs("../../../../foas/test/data/exemptions/" + tc.expectedOutput) require.NoError(t, err) cmd := exec.CommandContext(context.Background(), cliPath, diff --git a/tools/cli/test/e2e/cli/split_test.go b/tools/cli/test/e2e/cli/split_test.go index f1d0648462..cc21b8023b 100755 --- a/tools/cli/test/e2e/cli/split_test.go +++ b/tools/cli/test/e2e/cli/split_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/oasdiff/oasdiff/diff" "github.com/stretchr/testify/require" ) @@ -158,7 +158,7 @@ func TestSplitVersionsForOASWithExternalReferences(t *testing.T) { t.Parallel() folder := "dev" cliPath := NewBin(t) - base, err := filepath.Abs("../../data/split/" + folder + "/openapi-api-registry.json") + base, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-api-registry.json") require.NoError(t, err) copyMMSFileToOutput(t, folder) @@ -201,7 +201,7 @@ func copyMMSFileToOutput(t *testing.T, folder string) { t.Helper() // copy mms file to output folder because the split command will not copy it and it // is needed for external references - srcPath := "../../data/split/" + folder + "/openapi-mms.json" + srcPath := "../../../../foas/test/data/split/" + folder + "/openapi-mms.json" destPath := getOutputFolder(t, folder) + "/openapi-mms.json" cpCmd := exec.CommandContext(context.Background(), "cp", @@ -238,12 +238,12 @@ func getVersions(t *testing.T, cliPath, base, folder string) []string { func getInputPath(t *testing.T, specType, format, folder string) string { t.Helper() if specType == "not-filtered" { - cliPath, err := filepath.Abs("../../data/split/" + folder + "/openapi-mms.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-mms.json") require.NoError(t, err) return cliPath } - cliPath, err := filepath.Abs("../../data/split/" + folder + "/openapi-v2." + format) + cliPath, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-v2." + format) require.NoError(t, err) return cliPath } diff --git a/tools/cli/test/e2e/cli/sunset_test.go b/tools/cli/test/e2e/cli/sunset_test.go index 5d5cce6b53..f267e29878 100644 --- a/tools/cli/test/e2e/cli/sunset_test.go +++ b/tools/cli/test/e2e/cli/sunset_test.go @@ -9,13 +9,13 @@ import ( "path" "testing" - "github.com/mongodb/openapi/tools/cli/internal/cli/sunset" + "github.com/mongodb/openapi/tools/cli/sunset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestSunsetDiff_NoChanges(t *testing.T) { - baseSpecPath := "../../data/base_spec.json" + baseSpecPath := "../../../../foas/test/data/base_spec.json" outputPath := path.Join(getOutputFolder(t, "sunset"), "diff.json") cliPath := NewBin(t) @@ -45,8 +45,8 @@ func TestSunsetDiff_NoChanges(t *testing.T) { } func TestSunsetDiff_WithChanges(t *testing.T) { - baseSpecPath := "../../data/base_spec.json" - specPath := "../../data/base_spec_with_mismatching_sunset_dates.json" + baseSpecPath := "../../../../foas/test/data/base_spec.json" + specPath := "../../../../foas/test/data/base_spec_with_mismatching_sunset_dates.json" outputPath := path.Join(getOutputFolder(t, "sunset"), "diff.json") cliPath := NewBin(t) @@ -107,8 +107,8 @@ func TestSunsetDiff_WithChanges(t *testing.T) { } func TestSunsetDiff_WithFilteredChanges(t *testing.T) { - baseSpecPath := "../../data/base_spec.json" - specPath := "../../data/base_spec_with_mismatching_sunset_dates.json" + baseSpecPath := "../../../../foas/test/data/base_spec.json" + specPath := "../../../../foas/test/data/base_spec_with_mismatching_sunset_dates.json" outputPath := path.Join(getOutputFolder(t, "sunset"), "diff.json") cliPath := NewBin(t) diff --git a/tools/cli/internal/cli/usage/usage.go b/tools/cli/usage/usage.go similarity index 100% rename from tools/cli/internal/cli/usage/usage.go rename to tools/cli/usage/usage.go diff --git a/tools/cli/internal/cli/validator/command.go b/tools/cli/validator/command.go similarity index 100% rename from tools/cli/internal/cli/validator/command.go rename to tools/cli/validator/command.go diff --git a/tools/cli/internal/version/version.go b/tools/cli/version/version.go similarity index 100% rename from tools/cli/internal/version/version.go rename to tools/cli/version/version.go diff --git a/tools/cli/internal/cli/versions/versions.go b/tools/cli/versions/versions.go similarity index 95% rename from tools/cli/internal/cli/versions/versions.go rename to tools/cli/versions/versions.go index 720e9bad4d..1b542e48d8 100644 --- a/tools/cli/internal/cli/versions/versions.go +++ b/tools/cli/versions/versions.go @@ -20,10 +20,10 @@ import ( "fmt" "strings" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/tools/cli/internal/cli/versions/versions_test.go b/tools/cli/versions/versions_test.go similarity index 91% rename from tools/cli/internal/cli/versions/versions_test.go rename to tools/cli/versions/versions_test.go index 1c06d57945..49636454db 100644 --- a/tools/cli/internal/cli/versions/versions_test.go +++ b/tools/cli/versions/versions_test.go @@ -25,7 +25,7 @@ import ( func TestVersions_Run(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.json", fs: fs, } @@ -41,7 +41,7 @@ func TestVersions_Run(t *testing.T) { func TestVersion_RunWithEnv(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -59,7 +59,7 @@ func TestVersion_RunWithEnv(t *testing.T) { func TestVersion_RunWithPreview(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -78,7 +78,7 @@ func TestVersion_RunWithPreview(t *testing.T) { func TestVersion_RunWithUpcoming(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/openapi_with_upcoming.json", + basePath: "../../foas/test/data/openapi_with_upcoming.json", outputPath: "foas.json", fs: fs, env: "dev", @@ -94,7 +94,7 @@ func TestVersion_RunWithUpcoming(t *testing.T) { assert.Contains(t, string(b), "2025-09-22.upcoming") opts = &Opts{ - basePath: "../../../test/data/openapi_with_upcoming.json", + basePath: "../../foas/test/data/openapi_with_upcoming.json", outputPath: "foas.json", fs: fs, env: "prod", @@ -113,7 +113,7 @@ func TestVersion_RunWithUpcoming(t *testing.T) { func TestVersion_RunStabilityLevelPreviewAndPrivatePreview(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -133,7 +133,7 @@ func TestVersion_RunStabilityLevelPreviewAndPrivatePreview(t *testing.T) { func TestVersion_PreviewAndPublicPreview(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_public_preview.json", + basePath: "../../foas/test/data/base_spec_with_public_preview.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -153,7 +153,7 @@ func TestVersion_PreviewAndPublicPreview(t *testing.T) { func TestVersion_RunStabilityLevelStable(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.json", fs: fs, env: "staging", diff --git a/tools/foas/.golangci.yml b/tools/foas/.golangci.yml new file mode 100644 index 0000000000..55ae17c59b --- /dev/null +++ b/tools/foas/.golangci.yml @@ -0,0 +1,137 @@ +version: "2" +run: + modules-download-mode: readonly + tests: true +linters: + default: none + enable: + - copyloopvar + - dogsled + - errcheck + - errorlint + - exhaustive + - funlen + - gocritic + - godot + - goprintffuncname + - gosec + - govet + - ineffassign + - lll + - makezero + - misspell + - nakedret + - noctx + - nolintlint + - perfsprint + - prealloc + - predeclared + - revive + - rowserrcheck + - staticcheck + - testifylint + - thelper + - unconvert + - unused + - whitespace + # don't enable: + # - deadcode + # - varcheck + # - structcheck + # - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] + # - gocyclo # we already have funlen lint + # - dupl # we have a lot of duplicate test cases + # - gochecknoinits # we need the init function for the provider + # - gochecknoglobals # we need some global variables + # - unparam # Forces to create global variables when one variable is repeated in different functions + # - goerr113 # It does not allow you to return an error, you need to save the error in a variable to do it + # - goconst + # - gocognit + settings: + funlen: + lines: 360 + statements: 120 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + govet: + enable: + - shadow + lll: + line-length: 150 + misspell: + locale: US + nestif: + min-complexity: 7 + revive: + severity: warning + rules: + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: defer + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: early-return + - name: errorf + - name: exported + - name: import-shadowing + - name: indent-error-flow + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: empty-block + - name: superfluous-else + - name: struct-tag + - name: unused-parameter + - name: unreachable-code + - name: redefines-builtin-id + - name: unused-receiver + - name: constant-logical-expr + - name: confusing-naming + - name: unnecessary-stmt + - name: use-any + - name: imports-blocklist + arguments: + - github.com/pkg/errors + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gci + - gofmt + - goimports + settings: + gci: + sections: + - standard + - default + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/tools/foas/Makefile b/tools/foas/Makefile new file mode 100644 index 0000000000..9c8abe3cd6 --- /dev/null +++ b/tools/foas/Makefile @@ -0,0 +1,72 @@ +# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html + +GOLANGCI_VERSION=v2.10.1 +TEST_CMD?=go test +COVERAGE=coverage.out + +export TERM := linux-m +export GO111MODULE := on + +.PHONY: deps +deps: ## Download go module dependencies + @echo "==> Installing go.mod dependencies..." + go mod download + go mod tidy + +.PHONY: devtools +devtools: ## Install dev tools + @echo "==> Installing dev tools..." + go install go.uber.org/mock/mockgen@latest + go install github.com/oasdiff/oasdiff@v1.11.4 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) + +.PHONY: setup +setup: deps devtools ## Set up dev env + +.PHONY: fmt +fmt: ### Format all go files with goimports and gofmt + find . -name "*.go" -exec gofmt -w "{}" \; + find . -name "*.go" -exec goimports -l -w "{}" \; + +.PHONY: build +build: ## Build the library packages + @echo "==> Building foas library" + go build ./... + +.PHONY: lint +lint: ## Run linter + golangci-lint run + +.PHONY: fix-lint +fix-lint: ## Fix linting errors + golangci-lint run --fix + +.PHONY: list +list: ## List all make targets + @${MAKE} -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort + +.PHONY: gen-docs +gen-docs: ## Generate docs + @echo "==> Updating docs" + ./scripts/update_docs.sh + +.PHONY: unit-test +unit-test: ## Run unit-tests + @echo "==> Running unit tests..." + $(TEST_CMD) -race -cover ./... + +.PHONY: test +test: unit-test ## Alias for unit-test + +.PHONY: gen-mocks +gen-mocks: ## Generate mocks + @echo "==> Generating mocks" + go generate ./... + +.PHONY: pre-commit +pre-commit: fmt lint unit-test ## Run pre-commit checks + +.PHONY: help +.DEFAULT_GOAL := help +help: + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/tools/foas/README.md b/tools/foas/README.md new file mode 100644 index 0000000000..8aceef97c5 --- /dev/null +++ b/tools/foas/README.md @@ -0,0 +1,39 @@ +# FOASCLI +FOASCLI is a Go-based CLI tool that provides commands for generating the Federated OpenAPI specification and the API changelog. + +### Build From Source + +#### Fetch Source + +```bash +git clone https://github.com/mongodb/openapi.git +cd openapi/tools/foas +``` + +#### Build +To build `foascli`, run: + +```bash +make build +``` + +The resulting `foascli` binary is placed in `./bin`. + +## Usage +To get a list of available commands, run `foascli help`. + +## Setup Environment +To set up the development environment, run: +```bash +make setup +``` + +### Run tests +To run unit and e2e tests, run: +```bash +make lint && unit-test && e2e-test +``` + +## Contributing + +See our [CONTRIBUTING.md](../../CONTRIBUTING.md) guide. diff --git a/tools/foas/RELEASING.md b/tools/foas/RELEASING.md new file mode 100644 index 0000000000..a774fafedc --- /dev/null +++ b/tools/foas/RELEASING.md @@ -0,0 +1,28 @@ +# Release FOAS Library + +## Trigger release workflow + +- Using our [Release GitHub Action](https://github.com/mongodb/openapi/actions/workflows/release-foas.yml) run a new workflow using `main` and the following inputs: + - Version number: `vX.Y.Z` + - Skip tests: Should be left empty. Only used in case failing tests have been encountered and the team agrees the release can still be done. + - Using an existing tag: Should be left empty (default `false` creates a new tag from `main`). Set to `true` only if you want to re-use an existing tag for the release (e.g. rerunning a failed release where the tag is already created). + +- Using [GitHub CLI](https://cli.github.com/), run: + ```bash + # Replace vX.Y.Z with the release version + gh workflow run release-foas.yml -f version_number=vX.Y.Z -f skip_tests=false -f use_existing_tag=false + ``` + +## What the workflow does + +1. Validates the version number format. +2. Creates a single tag pointing at the release commit: + - `tools/foas/vX.Y.Z` — Go submodule tag. External consumers (e.g. mcp-server in [`mongodb-labs/oasis`](https://github.com/mongodb-labs/oasis)) pin this via `go.mod`. +3. Runs the library QA test suite (`code-health-foas.yml`) unless `skip_tests=true`. +4. No binary is produced — see [`tools/cli/RELEASING.md`](../cli/RELEASING.md) for the foascli binary release. + +## When to bump the library version + +Library releases are independent of binary releases. Bump whenever there's a change in `tools/foas/**` that downstream Go consumers might want — added public API, behavior changes, bug fixes. The library tends to release more frequently than the binary. + +Internal-only changes (test helpers, internal package refactors, docs in `internal/`) typically don't need a version bump. diff --git a/tools/cli/internal/apiversion/stabilitylevel.go b/tools/foas/apiversion/stabilitylevel.go similarity index 100% rename from tools/cli/internal/apiversion/stabilitylevel.go rename to tools/foas/apiversion/stabilitylevel.go diff --git a/tools/cli/internal/apiversion/stabilitylevel_test.go b/tools/foas/apiversion/stabilitylevel_test.go similarity index 100% rename from tools/cli/internal/apiversion/stabilitylevel_test.go rename to tools/foas/apiversion/stabilitylevel_test.go diff --git a/tools/cli/internal/apiversion/version.go b/tools/foas/apiversion/version.go similarity index 100% rename from tools/cli/internal/apiversion/version.go rename to tools/foas/apiversion/version.go diff --git a/tools/cli/internal/apiversion/version_test.go b/tools/foas/apiversion/version_test.go similarity index 100% rename from tools/cli/internal/apiversion/version_test.go rename to tools/foas/apiversion/version_test.go diff --git a/tools/cli/internal/breakingchanges/exemptions.go b/tools/foas/breakingchanges/exemptions.go similarity index 100% rename from tools/cli/internal/breakingchanges/exemptions.go rename to tools/foas/breakingchanges/exemptions.go diff --git a/tools/cli/internal/breakingchanges/exemptions_test.go b/tools/foas/breakingchanges/exemptions_test.go similarity index 99% rename from tools/cli/internal/breakingchanges/exemptions_test.go rename to tools/foas/breakingchanges/exemptions_test.go index ce6ccbd279..e45c786670 100644 --- a/tools/cli/internal/breakingchanges/exemptions_test.go +++ b/tools/foas/breakingchanges/exemptions_test.go @@ -24,7 +24,7 @@ import ( ) func TestGenerateExemptionsFileWithFs(t *testing.T) { - exemptionsFolder, err := filepath.Abs("../../test/data/exemptions") + exemptionsFolder, err := filepath.Abs("../test/data/exemptions") require.NoError(t, err) fs := afero.NewOsFs() diff --git a/tools/cli/internal/changelog/changelog.go b/tools/foas/changelog/changelog.go similarity index 99% rename from tools/cli/internal/changelog/changelog.go rename to tools/foas/changelog/changelog.go index 11aa883667..fac0ebb6fe 100644 --- a/tools/cli/internal/changelog/changelog.go +++ b/tools/foas/changelog/changelog.go @@ -22,8 +22,8 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/checker" "github.com/oasdiff/oasdiff/diff" "github.com/oasdiff/oasdiff/load" diff --git a/tools/cli/internal/changelog/changelog_test.go b/tools/foas/changelog/changelog_test.go similarity index 100% rename from tools/cli/internal/changelog/changelog_test.go rename to tools/foas/changelog/changelog_test.go diff --git a/tools/cli/internal/changelog/manual_entry.go b/tools/foas/changelog/manual_entry.go similarity index 97% rename from tools/cli/internal/changelog/manual_entry.go rename to tools/foas/changelog/manual_entry.go index 301509bc79..7a27355e4f 100644 --- a/tools/cli/internal/changelog/manual_entry.go +++ b/tools/foas/changelog/manual_entry.go @@ -19,7 +19,7 @@ import ( "log" "strings" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/oasdiff/oasdiff/checker" ) diff --git a/tools/cli/internal/changelog/manual_entry_test.go b/tools/foas/changelog/manual_entry_test.go similarity index 97% rename from tools/cli/internal/changelog/manual_entry_test.go rename to tools/foas/changelog/manual_entry_test.go index 76bd5db2f5..4c5d654d3f 100644 --- a/tools/cli/internal/changelog/manual_entry_test.go +++ b/tools/foas/changelog/manual_entry_test.go @@ -17,7 +17,7 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/changelog/merge.go b/tools/foas/changelog/merge.go similarity index 99% rename from tools/cli/internal/changelog/merge.go rename to tools/foas/changelog/merge.go index bf87ab072f..5513f57d04 100644 --- a/tools/cli/internal/changelog/merge.go +++ b/tools/foas/changelog/merge.go @@ -20,7 +20,7 @@ import ( "log" "sort" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/oasdiff/oasdiff/checker" ) diff --git a/tools/cli/internal/changelog/merge_test.go b/tools/foas/changelog/merge_test.go similarity index 98% rename from tools/cli/internal/changelog/merge_test.go rename to tools/foas/changelog/merge_test.go index c8e09c7524..9aefc75cd4 100644 --- a/tools/cli/internal/changelog/merge_test.go +++ b/tools/foas/changelog/merge_test.go @@ -17,13 +17,13 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestMergeChangelogOneChange(t *testing.T) { - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := baseChangelog[0].Date @@ -98,7 +98,7 @@ func TestMergeChangelogOneChange(t *testing.T) { func TestMergeChangelogTwoVersionsNoDeprecations(t *testing.T) { // arrange - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := baseChangelog[0].Date @@ -214,7 +214,7 @@ func TestMergeChangelogTwoVersionsNoDeprecations(t *testing.T) { } func TestMergeChangelogAddTwoEndpoints(t *testing.T) { - originalChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + originalChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := originalChangelog[0].Date @@ -467,7 +467,7 @@ func TestSortChangelog(t *testing.T) { func TestMergeChangelogTwoVersionsWithDeprecations(t *testing.T) { // arrange - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := baseChangelog[0].Date @@ -595,7 +595,7 @@ func TestMergeChangelogTwoVersionsWithDeprecations(t *testing.T) { } func TestMergeChangelogWithDeprecations(t *testing.T) { - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) firstVersion := "2023-02-01" @@ -717,7 +717,7 @@ func TestMergeChangelogWithDeprecations(t *testing.T) { } func TestMergeChangelogCompare(t *testing.T) { - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) firstVersion := "2023-01-01" diff --git a/tools/cli/internal/changelog/outputfilter/enum.go b/tools/foas/changelog/outputfilter/enum.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/enum.go rename to tools/foas/changelog/outputfilter/enum.go diff --git a/tools/cli/internal/changelog/outputfilter/enum_test.go b/tools/foas/changelog/outputfilter/enum_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/enum_test.go rename to tools/foas/changelog/outputfilter/enum_test.go diff --git a/tools/cli/internal/changelog/outputfilter/field.go b/tools/foas/changelog/outputfilter/field.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/field.go rename to tools/foas/changelog/outputfilter/field.go diff --git a/tools/cli/internal/changelog/outputfilter/field_test.go b/tools/foas/changelog/outputfilter/field_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/field_test.go rename to tools/foas/changelog/outputfilter/field_test.go diff --git a/tools/cli/internal/changelog/outputfilter/hide.go b/tools/foas/changelog/outputfilter/hide.go similarity index 98% rename from tools/cli/internal/changelog/outputfilter/hide.go rename to tools/foas/changelog/outputfilter/hide.go index e85f689667..5b23883540 100644 --- a/tools/cli/internal/changelog/outputfilter/hide.go +++ b/tools/foas/changelog/outputfilter/hide.go @@ -5,7 +5,7 @@ import ( "slices" "strings" - "github.com/mongodb/openapi/tools/cli/internal/breakingchanges" + "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/spf13/afero" ) diff --git a/tools/cli/internal/changelog/outputfilter/hide_test.go b/tools/foas/changelog/outputfilter/hide_test.go similarity index 98% rename from tools/cli/internal/changelog/outputfilter/hide_test.go rename to tools/foas/changelog/outputfilter/hide_test.go index a7968be203..8112dd9a8c 100644 --- a/tools/cli/internal/changelog/outputfilter/hide_test.go +++ b/tools/foas/changelog/outputfilter/hide_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/mongodb/openapi/tools/cli/internal/breakingchanges" + "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tools/cli/internal/changelog/outputfilter/message.go b/tools/foas/changelog/outputfilter/message.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/message.go rename to tools/foas/changelog/outputfilter/message.go diff --git a/tools/cli/internal/changelog/outputfilter/message_test.go b/tools/foas/changelog/outputfilter/message_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/message_test.go rename to tools/foas/changelog/outputfilter/message_test.go diff --git a/tools/cli/internal/changelog/outputfilter/operationconfig.go b/tools/foas/changelog/outputfilter/operationconfig.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/operationconfig.go rename to tools/foas/changelog/outputfilter/operationconfig.go diff --git a/tools/cli/internal/changelog/outputfilter/operationconfig_test.go b/tools/foas/changelog/outputfilter/operationconfig_test.go similarity index 98% rename from tools/cli/internal/changelog/outputfilter/operationconfig_test.go rename to tools/foas/changelog/outputfilter/operationconfig_test.go index dc725ec466..5bc4fd3b51 100644 --- a/tools/cli/internal/changelog/outputfilter/operationconfig_test.go +++ b/tools/foas/changelog/outputfilter/operationconfig_test.go @@ -5,14 +5,14 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/load" "github.com/stretchr/testify/require" ) func TestOpenApiSpecMethods(t *testing.T) { loader := openapi.NewOpenAPI3().WithExcludedPrivatePaths() - spec, err := loader.CreateOpenAPISpecFromPath("../../../test/data/changelog/manual_generated_test_spec.json") + spec, err := loader.CreateOpenAPISpecFromPath("../../test/data/changelog/manual_generated_test_spec.json") require.NoError(t, err) expectedConfig := map[string]*OperationConfig{ diff --git a/tools/cli/internal/changelog/outputfilter/outputfilter.go b/tools/foas/changelog/outputfilter/outputfilter.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/outputfilter.go rename to tools/foas/changelog/outputfilter/outputfilter.go diff --git a/tools/cli/internal/changelog/outputfilter/squash.go b/tools/foas/changelog/outputfilter/squash.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/squash.go rename to tools/foas/changelog/outputfilter/squash.go diff --git a/tools/cli/internal/changelog/outputfilter/squash_test.go b/tools/foas/changelog/outputfilter/squash_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/squash_test.go rename to tools/foas/changelog/outputfilter/squash_test.go diff --git a/tools/cli/internal/changelog/sunset.go b/tools/foas/changelog/sunset.go similarity index 98% rename from tools/cli/internal/changelog/sunset.go rename to tools/foas/changelog/sunset.go index e2f2cefdc9..6b4eccf3e7 100644 --- a/tools/cli/internal/changelog/sunset.go +++ b/tools/foas/changelog/sunset.go @@ -20,7 +20,7 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/oasdiff/oasdiff/checker" ) diff --git a/tools/cli/internal/changelog/sunset_test.go b/tools/foas/changelog/sunset_test.go similarity index 98% rename from tools/cli/internal/changelog/sunset_test.go rename to tools/foas/changelog/sunset_test.go index 1d455ad37a..4ec661245c 100644 --- a/tools/cli/internal/changelog/sunset_test.go +++ b/tools/foas/changelog/sunset_test.go @@ -17,7 +17,7 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/foas/go.mod b/tools/foas/go.mod new file mode 100644 index 0000000000..cb391e641a --- /dev/null +++ b/tools/foas/go.mod @@ -0,0 +1,43 @@ +module github.com/mongodb/openapi/tools/foas + +go 1.26 + +toolchain go1.26.0 + +require ( + github.com/getkin/kin-openapi v0.139.0 + github.com/iancoleman/strcase v0.3.0 + github.com/oasdiff/oasdiff v1.16.0 + github.com/spf13/afero v1.15.0 + github.com/stretchr/testify v1.11.1 + go.uber.org/mock v0.6.0 + golang.org/x/text v0.37.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + cloud.google.com/go v0.123.0 // indirect + github.com/TwiN/go-color v1.4.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/mailru/easyjson v0.9.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oasdiff/yaml v0.1.0 // indirect + github.com/oasdiff/yaml3 v0.0.13 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect + github.com/tidwall/gjson v1.18.0 // indirect + github.com/tidwall/match v1.2.0 // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/tidwall/sjson v1.2.5 // indirect + github.com/wI2L/jsondiff v0.7.1 // indirect + github.com/woodsbury/decimal128 v1.4.0 // indirect + github.com/yargevad/filepathx v1.0.0 // indirect + github.com/yuin/goldmark v1.8.2 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect +) diff --git a/tools/foas/go.sum b/tools/foas/go.sum new file mode 100644 index 0000000000..40138ab629 --- /dev/null +++ b/tools/foas/go.sum @@ -0,0 +1,88 @@ +cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= +cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= +github.com/TwiN/go-color v1.4.1 h1:mqG0P/KBgHKVqmtL5ye7K0/Gr4l6hTksPgTgMk3mUzc= +github.com/TwiN/go-color v1.4.1/go.mod h1:WcPf/jtiW95WBIsEeY1Lc/b8aaWoiqQpu5cf8WFxu+s= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/getkin/kin-openapi v0.139.0 h1:pBFXcZJFwz9J1X64jzxlOoNgFm+TF7kNrs9+HJVN6Ic= +github.com/getkin/kin-openapi v0.139.0/go.mod h1:NGxPfE4PwS/TRXEbyx2RrxDFPZvxcWw31Tw8XXjPZLs= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= +github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= +github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/oasdiff/oasdiff v1.16.0 h1:dcV0Y4oO84CrAKddUzdkjWDm/jHw0hXaohurxdgABRs= +github.com/oasdiff/oasdiff v1.16.0/go.mod h1:v/DNQeB3qIYBf33xxi1dReXImDUMaCk4QNX93jpwSzg= +github.com/oasdiff/yaml v0.1.0 h1:0bqZjfKc/8S9urj4JuwepX41WX9EoA6ifhU3SV06cXg= +github.com/oasdiff/yaml v0.1.0/go.mod h1:kOlRmMdL2X3vucLCEQO5u61SU22RysnfXvcttrZA1O0= +github.com/oasdiff/yaml3 v0.0.13 h1:06svmvOHOVBqF81+sY2EUScvUI/iS/vl2VIeUUxZQwg= +github.com/oasdiff/yaml3 v0.0.13/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM= +github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/wI2L/jsondiff v0.7.1 h1:Fg9+yj+1/x3UtPBJhR91TKEzRkrEEWcAcLbg9dzEaNM= +github.com/wI2L/jsondiff v0.7.1/go.mod h1:yAt2W7U6Jd4HK0RA8DGSGk0zDtfEtOUUJVnH/xICpjo= +github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= +github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= +github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= +github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= +github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE= +github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/cli/internal/openapi/errors/merge_conflict_error.go b/tools/foas/openapi/errors/merge_conflict_error.go similarity index 100% rename from tools/cli/internal/openapi/errors/merge_conflict_error.go rename to tools/foas/openapi/errors/merge_conflict_error.go diff --git a/tools/cli/internal/openapi/file.go b/tools/foas/openapi/file.go similarity index 100% rename from tools/cli/internal/openapi/file.go rename to tools/foas/openapi/file.go diff --git a/tools/cli/internal/openapi/file_test.go b/tools/foas/openapi/file_test.go similarity index 100% rename from tools/cli/internal/openapi/file_test.go rename to tools/foas/openapi/file_test.go diff --git a/tools/foas/openapi/filter/README.md b/tools/foas/openapi/filter/README.md new file mode 100644 index 0000000000..1c0befa1f9 --- /dev/null +++ b/tools/foas/openapi/filter/README.md @@ -0,0 +1,21 @@ +# List of filters applied to the OpenAPI specification +These examples are automatically generated from filters docs. +# OpenAPI Filters +## Why filtering OpenAPI? +The Atlas Admin API OpenAPI specifications are used not only to document REST endpoints, but also to capture extra functionality such as Versioning information, team ownership, and more. This extra information is used to then correctly generate the OpenAPI respective to each version of the API. +## What is the general filter purpose? + - Filtering per environment, so that only the endpoints that are available in that environment are shown. + - Filtering per version, so that only the endpoints that are available in that version are shown. +## What filters are available? +### List of filters +[BumpFilter modifies includes the fields "x-state" and "x-beta" to the "preview" and "upcoming" APIs Operations.](./bump.go?plain=1#L21) +[CodeSampleFilter modifies includes the fields "x-state" and "x-beta" to the "preview" and "upcoming" APIs Operations.](./code_sample.go?plain=1#L45) +[ExtensionFilter is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec.](./extension.go?plain=1#L21) +[HiddenEnvsFilter removes paths, operations, request/response bodies and content types](./hidden_envs.go?plain=1#L30) +[InfoVersioningFilter modifies the Info object in the OpenAPI spec with the target version.](./info.go?plain=1#L24) +[OperationsFilter is a filter that removes the x-xgen-owner-team extension from operations.](./operations.go?plain=1#L21) +[SchemasFilter removes unused #/components/schemas/.](./schemas.go?plain=1#L27) +[SunsetFilter removes the sunsetToBeDecided from the openapi specification.](./sunset.go?plain=1#L26) +[TagsFilter removes tags that are not used in the operations.](./tags.go?plain=1#L23) +[VersioningExtensionFilter is a filter that updates the x-sunset and x-xgen-version extensions to a date string](./versioning_extension.go?plain=1#L25) +[VersioningFilter is a filter that modifies the OpenAPI spec by removing paths, operations and responses](./versioning.go?plain=1#L25) diff --git a/tools/cli/internal/openapi/filter/bump.go b/tools/foas/openapi/filter/bump.go similarity index 100% rename from tools/cli/internal/openapi/filter/bump.go rename to tools/foas/openapi/filter/bump.go diff --git a/tools/cli/internal/openapi/filter/bump_test.go b/tools/foas/openapi/filter/bump_test.go similarity index 98% rename from tools/cli/internal/openapi/filter/bump_test.go rename to tools/foas/openapi/filter/bump_test.go index 3b14f40048..7879dedd45 100644 --- a/tools/cli/internal/openapi/filter/bump_test.go +++ b/tools/foas/openapi/filter/bump_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/code_sample.go b/tools/foas/openapi/filter/code_sample.go similarity index 99% rename from tools/cli/internal/openapi/filter/code_sample.go rename to tools/foas/openapi/filter/code_sample.go index f88d99fdbc..cac09a80b6 100644 --- a/tools/cli/internal/openapi/filter/code_sample.go +++ b/tools/foas/openapi/filter/code_sample.go @@ -25,7 +25,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" "github.com/iancoleman/strcase" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "golang.org/x/text/cases" "golang.org/x/text/language" ) diff --git a/tools/cli/internal/openapi/filter/code_sample_test.go b/tools/foas/openapi/filter/code_sample_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/code_sample_test.go rename to tools/foas/openapi/filter/code_sample_test.go index 40865eaf94..d0c09ebe53 100644 --- a/tools/cli/internal/openapi/filter/code_sample_test.go +++ b/tools/foas/openapi/filter/code_sample_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/extension.go b/tools/foas/openapi/filter/extension.go similarity index 100% rename from tools/cli/internal/openapi/filter/extension.go rename to tools/foas/openapi/filter/extension.go diff --git a/tools/cli/internal/openapi/filter/extension_test.go b/tools/foas/openapi/filter/extension_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/extension_test.go rename to tools/foas/openapi/filter/extension_test.go index c39aff6b8b..56d69c2242 100644 --- a/tools/cli/internal/openapi/filter/extension_test.go +++ b/tools/foas/openapi/filter/extension_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/filter.go b/tools/foas/openapi/filter/filter.go similarity index 98% rename from tools/cli/internal/openapi/filter/filter.go rename to tools/foas/openapi/filter/filter.go index de5e0daa40..74f4d37376 100644 --- a/tools/cli/internal/openapi/filter/filter.go +++ b/tools/foas/openapi/filter/filter.go @@ -22,10 +22,10 @@ import ( reflect "reflect" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) -//go:generate mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/cli/internal/openapi/filter Filter +//go:generate mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/foas/openapi/filter Filter type Filter interface { Apply() error ValidateMetadata() error diff --git a/tools/cli/internal/openapi/filter/filter_test.go b/tools/foas/openapi/filter/filter_test.go similarity index 98% rename from tools/cli/internal/openapi/filter/filter_test.go rename to tools/foas/openapi/filter/filter_test.go index 7cc14eadf5..0c6b31a18a 100644 --- a/tools/cli/internal/openapi/filter/filter_test.go +++ b/tools/foas/openapi/filter/filter_test.go @@ -17,7 +17,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/hidden_envs.go b/tools/foas/openapi/filter/hidden_envs.go similarity index 99% rename from tools/cli/internal/openapi/filter/hidden_envs.go rename to tools/foas/openapi/filter/hidden_envs.go index cc704e6259..c551f9454a 100644 --- a/tools/cli/internal/openapi/filter/hidden_envs.go +++ b/tools/foas/openapi/filter/hidden_envs.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) const ( diff --git a/tools/cli/internal/openapi/filter/hidden_envs_test.go b/tools/foas/openapi/filter/hidden_envs_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/hidden_envs_test.go rename to tools/foas/openapi/filter/hidden_envs_test.go index 3be3caa0b7..253bab1333 100644 --- a/tools/cli/internal/openapi/filter/hidden_envs_test.go +++ b/tools/foas/openapi/filter/hidden_envs_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/info.go b/tools/foas/openapi/filter/info.go similarity index 96% rename from tools/cli/internal/openapi/filter/info.go rename to tools/foas/openapi/filter/info.go index 2def0cdba1..62db68166a 100644 --- a/tools/cli/internal/openapi/filter/info.go +++ b/tools/foas/openapi/filter/info.go @@ -18,7 +18,7 @@ import ( "fmt" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) // InfoVersioningFilter modifies the Info object in the OpenAPI spec with the target version. diff --git a/tools/cli/internal/openapi/filter/info_test.go b/tools/foas/openapi/filter/info_test.go similarity index 97% rename from tools/cli/internal/openapi/filter/info_test.go rename to tools/foas/openapi/filter/info_test.go index 5b8f099cbb..26f76879c3 100644 --- a/tools/cli/internal/openapi/filter/info_test.go +++ b/tools/foas/openapi/filter/info_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/mock_filter.go b/tools/foas/openapi/filter/mock_filter.go similarity index 88% rename from tools/cli/internal/openapi/filter/mock_filter.go rename to tools/foas/openapi/filter/mock_filter.go index 30d17193b6..71df6d27fb 100644 --- a/tools/cli/internal/openapi/filter/mock_filter.go +++ b/tools/foas/openapi/filter/mock_filter.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/mongodb/openapi/tools/cli/internal/openapi/filter (interfaces: Filter) +// Source: github.com/mongodb/openapi/tools/foas/openapi/filter (interfaces: Filter) // // Generated by this command: // -// mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/cli/internal/openapi/filter Filter +// mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/foas/openapi/filter Filter // // Package filter is a generated GoMock package. diff --git a/tools/cli/internal/openapi/filter/operations.go b/tools/foas/openapi/filter/operations.go similarity index 100% rename from tools/cli/internal/openapi/filter/operations.go rename to tools/foas/openapi/filter/operations.go diff --git a/tools/cli/internal/openapi/filter/operations_test.go b/tools/foas/openapi/filter/operations_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/operations_test.go rename to tools/foas/openapi/filter/operations_test.go diff --git a/tools/cli/internal/openapi/filter/parameters.go b/tools/foas/openapi/filter/parameters.go similarity index 100% rename from tools/cli/internal/openapi/filter/parameters.go rename to tools/foas/openapi/filter/parameters.go diff --git a/tools/cli/internal/openapi/filter/parameters_test.go b/tools/foas/openapi/filter/parameters_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/parameters_test.go rename to tools/foas/openapi/filter/parameters_test.go index 4aa99a37b2..fb0ff4a5cb 100644 --- a/tools/cli/internal/openapi/filter/parameters_test.go +++ b/tools/foas/openapi/filter/parameters_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/response.go b/tools/foas/openapi/filter/response.go similarity index 100% rename from tools/cli/internal/openapi/filter/response.go rename to tools/foas/openapi/filter/response.go diff --git a/tools/cli/internal/openapi/filter/response_test.go b/tools/foas/openapi/filter/response_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/response_test.go rename to tools/foas/openapi/filter/response_test.go index 5efcd5d6db..f6faaf719f 100644 --- a/tools/cli/internal/openapi/filter/response_test.go +++ b/tools/foas/openapi/filter/response_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/schemas.go b/tools/foas/openapi/filter/schemas.go similarity index 100% rename from tools/cli/internal/openapi/filter/schemas.go rename to tools/foas/openapi/filter/schemas.go diff --git a/tools/cli/internal/openapi/filter/schemas_test.go b/tools/foas/openapi/filter/schemas_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/schemas_test.go rename to tools/foas/openapi/filter/schemas_test.go diff --git a/tools/cli/internal/openapi/filter/sunset.go b/tools/foas/openapi/filter/sunset.go similarity index 100% rename from tools/cli/internal/openapi/filter/sunset.go rename to tools/foas/openapi/filter/sunset.go diff --git a/tools/cli/internal/openapi/filter/sunset_test.go b/tools/foas/openapi/filter/sunset_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/sunset_test.go rename to tools/foas/openapi/filter/sunset_test.go diff --git a/tools/cli/internal/openapi/filter/tags.go b/tools/foas/openapi/filter/tags.go similarity index 100% rename from tools/cli/internal/openapi/filter/tags.go rename to tools/foas/openapi/filter/tags.go diff --git a/tools/cli/internal/openapi/filter/tags_test.go b/tools/foas/openapi/filter/tags_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/tags_test.go rename to tools/foas/openapi/filter/tags_test.go diff --git a/tools/cli/internal/openapi/filter/template/go_sdk_code_sample.go.tmpl b/tools/foas/openapi/filter/template/go_sdk_code_sample.go.tmpl similarity index 100% rename from tools/cli/internal/openapi/filter/template/go_sdk_code_sample.go.tmpl rename to tools/foas/openapi/filter/template/go_sdk_code_sample.go.tmpl diff --git a/tools/cli/internal/openapi/filter/versioning.go b/tools/foas/openapi/filter/versioning.go similarity index 99% rename from tools/cli/internal/openapi/filter/versioning.go rename to tools/foas/openapi/filter/versioning.go index b78b4d9a6e..5179dd3378 100644 --- a/tools/cli/internal/openapi/filter/versioning.go +++ b/tools/foas/openapi/filter/versioning.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) // VersioningFilter is a filter that modifies the OpenAPI spec by removing paths, operations and responses diff --git a/tools/cli/internal/openapi/filter/versioning_extension.go b/tools/foas/openapi/filter/versioning_extension.go similarity index 98% rename from tools/cli/internal/openapi/filter/versioning_extension.go rename to tools/foas/openapi/filter/versioning_extension.go index 71f01a9eab..5590df2ac4 100644 --- a/tools/cli/internal/openapi/filter/versioning_extension.go +++ b/tools/foas/openapi/filter/versioning_extension.go @@ -19,7 +19,7 @@ import ( "time" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) // VersioningExtensionFilter is a filter that updates the x-sunset and x-xgen-version extensions to a date string diff --git a/tools/cli/internal/openapi/filter/versioning_extension_test.go b/tools/foas/openapi/filter/versioning_extension_test.go similarity index 98% rename from tools/cli/internal/openapi/filter/versioning_extension_test.go rename to tools/foas/openapi/filter/versioning_extension_test.go index bbd1d2ce2a..5de8eead0f 100644 --- a/tools/cli/internal/openapi/filter/versioning_extension_test.go +++ b/tools/foas/openapi/filter/versioning_extension_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/versioning_test.go b/tools/foas/openapi/filter/versioning_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/versioning_test.go rename to tools/foas/openapi/filter/versioning_test.go index 8a0fc6e14f..90c91773be 100644 --- a/tools/cli/internal/openapi/filter/versioning_test.go +++ b/tools/foas/openapi/filter/versioning_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/mock_oasdiff_result.go b/tools/foas/openapi/mock_oasdiff_result.go similarity index 93% rename from tools/cli/internal/openapi/mock_oasdiff_result.go rename to tools/foas/openapi/mock_oasdiff_result.go index 825b8f1d1b..b971ce3170 100644 --- a/tools/cli/internal/openapi/mock_oasdiff_result.go +++ b/tools/foas/openapi/mock_oasdiff_result.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/mongodb/openapi/tools/cli/internal/openapi (interfaces: DiffGetter) +// Source: github.com/mongodb/openapi/tools/foas/openapi (interfaces: DiffGetter) // // Generated by this command: // -// mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi DiffGetter +// mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi DiffGetter // // Package openapi is a generated GoMock package. diff --git a/tools/cli/internal/openapi/mock_openapi.go b/tools/foas/openapi/mock_openapi.go similarity index 94% rename from tools/cli/internal/openapi/mock_openapi.go rename to tools/foas/openapi/mock_openapi.go index f41622cd46..70dddcb737 100644 --- a/tools/cli/internal/openapi/mock_openapi.go +++ b/tools/foas/openapi/mock_openapi.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/mongodb/openapi/tools/cli/internal/openapi (interfaces: Parser,Merger) +// Source: github.com/mongodb/openapi/tools/foas/openapi (interfaces: Parser,Merger) // // Generated by this command: // -// mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi Parser,Merger +// mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi Parser,Merger // // Package openapi is a generated GoMock package. diff --git a/tools/cli/internal/openapi/oasdiff.go b/tools/foas/openapi/oasdiff.go similarity index 99% rename from tools/cli/internal/openapi/oasdiff.go rename to tools/foas/openapi/oasdiff.go index 2c6f8b4475..9f607639ff 100644 --- a/tools/cli/internal/openapi/oasdiff.go +++ b/tools/foas/openapi/oasdiff.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi/errors" + "github.com/mongodb/openapi/tools/foas/openapi/errors" "github.com/oasdiff/oasdiff/diff" "github.com/oasdiff/oasdiff/load" ) diff --git a/tools/cli/internal/openapi/oasdiff_result.go b/tools/foas/openapi/oasdiff_result.go similarity index 97% rename from tools/cli/internal/openapi/oasdiff_result.go rename to tools/foas/openapi/oasdiff_result.go index c3b7d029a4..e6249b9927 100644 --- a/tools/cli/internal/openapi/oasdiff_result.go +++ b/tools/foas/openapi/oasdiff_result.go @@ -14,7 +14,7 @@ package openapi -//go:generate mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi DiffGetter +//go:generate mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi DiffGetter import ( "github.com/getkin/kin-openapi/openapi3" "github.com/oasdiff/oasdiff/diff" diff --git a/tools/cli/internal/openapi/oasdiff_result_test.go b/tools/foas/openapi/oasdiff_result_test.go similarity index 100% rename from tools/cli/internal/openapi/oasdiff_result_test.go rename to tools/foas/openapi/oasdiff_result_test.go diff --git a/tools/cli/internal/openapi/oasdiff_test.go b/tools/foas/openapi/oasdiff_test.go similarity index 99% rename from tools/cli/internal/openapi/oasdiff_test.go rename to tools/foas/openapi/oasdiff_test.go index 76d3226699..15405e6a6e 100644 --- a/tools/cli/internal/openapi/oasdiff_test.go +++ b/tools/foas/openapi/oasdiff_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi/errors" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/openapi/errors" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/oasdiff/oasdiff/diff" "github.com/oasdiff/oasdiff/load" "github.com/stretchr/testify/assert" diff --git a/tools/cli/internal/openapi/openapi.go b/tools/foas/openapi/openapi.go similarity index 98% rename from tools/cli/internal/openapi/openapi.go rename to tools/foas/openapi/openapi.go index 6c5e4b7576..ef6147d05d 100644 --- a/tools/cli/internal/openapi/openapi.go +++ b/tools/foas/openapi/openapi.go @@ -14,7 +14,7 @@ package openapi -//go:generate mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi Parser,Merger +//go:generate mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi Parser,Merger import ( "encoding/json" "log" diff --git a/tools/cli/internal/openapi/openapi3.go b/tools/foas/openapi/openapi3.go similarity index 100% rename from tools/cli/internal/openapi/openapi3.go rename to tools/foas/openapi/openapi3.go diff --git a/tools/cli/internal/openapi/openapi3_test.go b/tools/foas/openapi/openapi3_test.go similarity index 100% rename from tools/cli/internal/openapi/openapi3_test.go rename to tools/foas/openapi/openapi3_test.go diff --git a/tools/cli/internal/openapi/openapi_test.go b/tools/foas/openapi/openapi_test.go similarity index 100% rename from tools/cli/internal/openapi/openapi_test.go rename to tools/foas/openapi/openapi_test.go diff --git a/tools/cli/internal/openapi/paths.go b/tools/foas/openapi/paths.go similarity index 100% rename from tools/cli/internal/openapi/paths.go rename to tools/foas/openapi/paths.go diff --git a/tools/cli/internal/openapi/paths_test.go b/tools/foas/openapi/paths_test.go similarity index 100% rename from tools/cli/internal/openapi/paths_test.go rename to tools/foas/openapi/paths_test.go diff --git a/tools/cli/internal/openapi/slice/slice.go b/tools/foas/openapi/slice/slice.go similarity index 97% rename from tools/cli/internal/openapi/slice/slice.go rename to tools/foas/openapi/slice/slice.go index 99056473d4..759742deb1 100644 --- a/tools/cli/internal/openapi/slice/slice.go +++ b/tools/foas/openapi/slice/slice.go @@ -20,7 +20,7 @@ import ( "slices" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi/filter" + "github.com/mongodb/openapi/tools/foas/openapi/filter" ) // Criteria defines the selection criteria for slicing an OpenAPI spec. diff --git a/tools/cli/internal/openapi/slice/slice_test.go b/tools/foas/openapi/slice/slice_test.go similarity index 100% rename from tools/cli/internal/openapi/slice/slice_test.go rename to tools/foas/openapi/slice/slice_test.go diff --git a/tools/cli/internal/openapi/sunset/sunset.go b/tools/foas/openapi/sunset/sunset.go similarity index 100% rename from tools/cli/internal/openapi/sunset/sunset.go rename to tools/foas/openapi/sunset/sunset.go diff --git a/tools/cli/internal/openapi/sunset/sunset_test.go b/tools/foas/openapi/sunset/sunset_test.go similarity index 100% rename from tools/cli/internal/openapi/sunset/sunset_test.go rename to tools/foas/openapi/sunset/sunset_test.go diff --git a/tools/cli/internal/openapi/versions.go b/tools/foas/openapi/versions.go similarity index 96% rename from tools/cli/internal/openapi/versions.go rename to tools/foas/openapi/versions.go index c30b8521e8..368c88eb13 100644 --- a/tools/cli/internal/openapi/versions.go +++ b/tools/foas/openapi/versions.go @@ -21,8 +21,8 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/openapi/filter" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/openapi/filter" ) // ExtractVersionsWithEnv extracts API version Content Type strings from the given OpenAPI specification and environment. diff --git a/tools/cli/internal/openapi/versions_test.go b/tools/foas/openapi/versions_test.go similarity index 100% rename from tools/cli/internal/openapi/versions_test.go rename to tools/foas/openapi/versions_test.go diff --git a/tools/cli/internal/pointer/pointer.go b/tools/foas/pointer/pointer.go similarity index 100% rename from tools/cli/internal/pointer/pointer.go rename to tools/foas/pointer/pointer.go diff --git a/tools/cli/scripts/doc_filters.sh b/tools/foas/scripts/doc_filters.sh similarity index 72% rename from tools/cli/scripts/doc_filters.sh rename to tools/foas/scripts/doc_filters.sh index c6160c8854..228dd1bd53 100755 --- a/tools/cli/scripts/doc_filters.sh +++ b/tools/foas/scripts/doc_filters.sh @@ -3,8 +3,8 @@ echo "# List of filters applied to the OpenAPI specification" echo "These examples are automatically generated from filters docs." -# Expected format: -# // PlaceHolderFilter: is a filter that modifies the Info object in the OpenAPI spec. +# Expected format (Go doc comment on the type declaration): +# // PlaceHolderFilter is a filter that modifies the Info object in the OpenAPI spec. echo "# OpenAPI Filters" @@ -19,4 +19,4 @@ echo " - Filtering per version, so that only the endpoints that are available in echo "## What filters are available?" echo "### List of filters" -grep -n '// .*Filter: .*' internal/openapi/filter/*.go | sort -u -k2 | sed -n "s/\([^0-9]*\):\([0-9]*\):\/\/ \(.*Filter: .*\)/[\3](\.\.\/\1?plain=1#L\2) /p" | sort +grep -n '^// [A-Z][A-Za-z]*Filter ' openapi/filter/*.go | grep -v Mock | sort -u -k2 | sed -n "s|openapi/filter/\([^:]*\):\([0-9]*\):// \(.*\)|[\3](./\1?plain=1#L\2) |p" | sort diff --git a/tools/foas/scripts/update_docs.sh b/tools/foas/scripts/update_docs.sh new file mode 100755 index 0000000000..89c01ee43f --- /dev/null +++ b/tools/foas/scripts/update_docs.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -euxo pipefail + +# Update the filters documentation +./scripts/doc_filters.sh > openapi/filter/README.md + +go fmt ./... + +if [ -n "$(git status --porcelain openapi/filter/README.md)" ]; then + git add "openapi/filter/README.md" +fi \ No newline at end of file diff --git a/tools/cli/test/data/apiregistry_spec.json b/tools/foas/test/data/apiregistry_spec.json similarity index 100% rename from tools/cli/test/data/apiregistry_spec.json rename to tools/foas/test/data/apiregistry_spec.json diff --git a/tools/cli/test/data/authn_spec.json b/tools/foas/test/data/authn_spec.json similarity index 100% rename from tools/cli/test/data/authn_spec.json rename to tools/foas/test/data/authn_spec.json diff --git a/tools/cli/test/data/base_spec.json b/tools/foas/test/data/base_spec.json similarity index 100% rename from tools/cli/test/data/base_spec.json rename to tools/foas/test/data/base_spec.json diff --git a/tools/cli/test/data/base_spec_with_mismatching_sunset_dates.json b/tools/foas/test/data/base_spec_with_mismatching_sunset_dates.json similarity index 100% rename from tools/cli/test/data/base_spec_with_mismatching_sunset_dates.json rename to tools/foas/test/data/base_spec_with_mismatching_sunset_dates.json diff --git a/tools/cli/test/data/base_spec_with_multiple_private_and_public_previews.json b/tools/foas/test/data/base_spec_with_multiple_private_and_public_previews.json similarity index 100% rename from tools/cli/test/data/base_spec_with_multiple_private_and_public_previews.json rename to tools/foas/test/data/base_spec_with_multiple_private_and_public_previews.json diff --git a/tools/cli/test/data/base_spec_with_private_preview.json b/tools/foas/test/data/base_spec_with_private_preview.json similarity index 100% rename from tools/cli/test/data/base_spec_with_private_preview.json rename to tools/foas/test/data/base_spec_with_private_preview.json diff --git a/tools/cli/test/data/base_spec_with_public_preview.json b/tools/foas/test/data/base_spec_with_public_preview.json similarity index 100% rename from tools/cli/test/data/base_spec_with_public_preview.json rename to tools/foas/test/data/base_spec_with_public_preview.json diff --git a/tools/cli/test/data/changelog/changelog.json b/tools/foas/test/data/changelog/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/changelog.json rename to tools/foas/test/data/changelog/changelog.json diff --git a/tools/cli/test/data/changelog/manual_generated_test_spec.json b/tools/foas/test/data/changelog/manual_generated_test_spec.json similarity index 100% rename from tools/cli/test/data/changelog/manual_generated_test_spec.json rename to tools/foas/test/data/changelog/manual_generated_test_spec.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/changelog.json b/tools/foas/test/data/changelog/new-api-preview-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/changelog.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/metadata.json b/tools/foas/test/data/changelog/new-api-preview-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/metadata.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/exemptions.yaml b/tools/foas/test/data/changelog/new-api-preview-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-preview-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/changelog-all.json b/tools/foas/test/data/changelog/new-api-preview-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/changelog-all.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/changelog.json b/tools/foas/test/data/changelog/new-api-preview-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/changelog.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/new-api-preview-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-preview-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/metadata.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/metadata.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-preview.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-preview.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-preview.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-preview.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/changelog.json b/tools/foas/test/data/changelog/new-api-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/changelog.json rename to tools/foas/test/data/changelog/new-api-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/metadata.json b/tools/foas/test/data/changelog/new-api-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/metadata.json rename to tools/foas/test/data/changelog/new-api-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/exemptions.yaml b/tools/foas/test/data/changelog/new-api-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/changelog-all.json b/tools/foas/test/data/changelog/new-api-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/changelog-all.json rename to tools/foas/test/data/changelog/new-api-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/changelog.json b/tools/foas/test/data/changelog/new-api-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/changelog.json rename to tools/foas/test/data/changelog/new-api-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/new-api-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-version/revision/metadata.json b/tools/foas/test/data/changelog/new-api-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/metadata.json rename to tools/foas/test/data/changelog/new-api-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/changelog-all.json b/tools/foas/test/data/changelog/new-upcoming-version/base/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/changelog-all.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/changelog.json b/tools/foas/test/data/changelog/new-upcoming-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/changelog.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/metadata.json b/tools/foas/test/data/changelog/new-upcoming-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/metadata.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-preview.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-preview.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-preview.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-preview.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/exemptions.yaml b/tools/foas/test/data/changelog/new-upcoming-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/exemptions.yaml rename to tools/foas/test/data/changelog/new-upcoming-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/changelog-all.json b/tools/foas/test/data/changelog/new-upcoming-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/changelog-all.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/changelog.json b/tools/foas/test/data/changelog/new-upcoming-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/changelog.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/new-upcoming-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/new-upcoming-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/metadata.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/metadata.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-preview.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-preview.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-preview.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-preview.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/changelog.json b/tools/foas/test/data/changelog/rename-api-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/changelog.json rename to tools/foas/test/data/changelog/rename-api-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/metadata.json b/tools/foas/test/data/changelog/rename-api-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/metadata.json rename to tools/foas/test/data/changelog/rename-api-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/exemptions.yaml b/tools/foas/test/data/changelog/rename-api-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/exemptions.yaml rename to tools/foas/test/data/changelog/rename-api-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/changelog-all.json b/tools/foas/test/data/changelog/rename-api-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/changelog-all.json rename to tools/foas/test/data/changelog/rename-api-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/changelog.json b/tools/foas/test/data/changelog/rename-api-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/changelog.json rename to tools/foas/test/data/changelog/rename-api-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/rename-api-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/rename-api-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/metadata.json b/tools/foas/test/data/changelog/rename-api-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/metadata.json rename to tools/foas/test/data/changelog/rename-api-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/changelog.json b/tools/foas/test/data/changelog/same-api-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/changelog.json rename to tools/foas/test/data/changelog/same-api-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/metadata.json b/tools/foas/test/data/changelog/same-api-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/metadata.json rename to tools/foas/test/data/changelog/same-api-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/exemptions.yaml b/tools/foas/test/data/changelog/same-api-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/exemptions.yaml rename to tools/foas/test/data/changelog/same-api-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/changelog-all.json b/tools/foas/test/data/changelog/same-api-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/changelog-all.json rename to tools/foas/test/data/changelog/same-api-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/changelog.json b/tools/foas/test/data/changelog/same-api-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/changelog.json rename to tools/foas/test/data/changelog/same-api-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/metadata.json b/tools/foas/test/data/changelog/same-api-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/metadata.json rename to tools/foas/test/data/changelog/same-api-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/duplicated_path_apiregistry_spec.json b/tools/foas/test/data/duplicated_path_apiregistry_spec.json similarity index 100% rename from tools/cli/test/data/duplicated_path_apiregistry_spec.json rename to tools/foas/test/data/duplicated_path_apiregistry_spec.json diff --git a/tools/cli/test/data/duplicated_tag_authn_spec.json b/tools/foas/test/data/duplicated_tag_authn_spec.json similarity index 100% rename from tools/cli/test/data/duplicated_tag_authn_spec.json rename to tools/foas/test/data/duplicated_tag_authn_spec.json diff --git a/tools/cli/test/data/exemptions/exemptions.txt b/tools/foas/test/data/exemptions/exemptions.txt similarity index 100% rename from tools/cli/test/data/exemptions/exemptions.txt rename to tools/foas/test/data/exemptions/exemptions.txt diff --git a/tools/cli/test/data/exemptions/invalid_exemptions.yaml b/tools/foas/test/data/exemptions/invalid_exemptions.yaml similarity index 100% rename from tools/cli/test/data/exemptions/invalid_exemptions.yaml rename to tools/foas/test/data/exemptions/invalid_exemptions.yaml diff --git a/tools/cli/test/data/exemptions/test_exemptions_expired.yaml b/tools/foas/test/data/exemptions/test_exemptions_expired.yaml similarity index 100% rename from tools/cli/test/data/exemptions/test_exemptions_expired.yaml rename to tools/foas/test/data/exemptions/test_exemptions_expired.yaml diff --git a/tools/cli/test/data/exemptions/test_exemptions_schema.yaml b/tools/foas/test/data/exemptions/test_exemptions_schema.yaml similarity index 100% rename from tools/cli/test/data/exemptions/test_exemptions_schema.yaml rename to tools/foas/test/data/exemptions/test_exemptions_schema.yaml diff --git a/tools/cli/test/data/exemptions/test_exemptions_v2_duplication.yaml b/tools/foas/test/data/exemptions/test_exemptions_v2_duplication.yaml similarity index 100% rename from tools/cli/test/data/exemptions/test_exemptions_v2_duplication.yaml rename to tools/foas/test/data/exemptions/test_exemptions_v2_duplication.yaml diff --git a/tools/cli/test/data/exemptions/valid_exemptions.yaml b/tools/foas/test/data/exemptions/valid_exemptions.yaml similarity index 100% rename from tools/cli/test/data/exemptions/valid_exemptions.yaml rename to tools/foas/test/data/exemptions/valid_exemptions.yaml diff --git a/tools/cli/test/data/not_identical_component_apiregistry_spec.json b/tools/foas/test/data/not_identical_component_apiregistry_spec.json similarity index 100% rename from tools/cli/test/data/not_identical_component_apiregistry_spec.json rename to tools/foas/test/data/not_identical_component_apiregistry_spec.json diff --git a/tools/cli/test/data/openapi-foas-dev.json b/tools/foas/test/data/openapi-foas-dev.json similarity index 100% rename from tools/cli/test/data/openapi-foas-dev.json rename to tools/foas/test/data/openapi-foas-dev.json diff --git a/tools/cli/test/data/openapi-foas-dev.yaml b/tools/foas/test/data/openapi-foas-dev.yaml similarity index 100% rename from tools/cli/test/data/openapi-foas-dev.yaml rename to tools/foas/test/data/openapi-foas-dev.yaml diff --git a/tools/cli/test/data/openapi_with_upcoming.json b/tools/foas/test/data/openapi_with_upcoming.json similarity index 100% rename from tools/cli/test/data/openapi_with_upcoming.json rename to tools/foas/test/data/openapi_with_upcoming.json diff --git a/tools/cli/test/data/split/dev/README.md b/tools/foas/test/data/split/dev/README.md similarity index 100% rename from tools/cli/test/data/split/dev/README.md rename to tools/foas/test/data/split/dev/README.md diff --git a/tools/cli/test/data/split/dev/openapi-api-registry.json b/tools/foas/test/data/split/dev/openapi-api-registry.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-api-registry.json rename to tools/foas/test/data/split/dev/openapi-api-registry.json diff --git a/tools/cli/test/data/split/dev/openapi-mms.json b/tools/foas/test/data/split/dev/openapi-mms.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-mms.json rename to tools/foas/test/data/split/dev/openapi-mms.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json b/tools/foas/test/data/split/dev/openapi-v2-2023-01-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-01-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-01-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-01-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json b/tools/foas/test/data/split/dev/openapi-v2-2023-02-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-02-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-02-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-02-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json b/tools/foas/test/data/split/dev/openapi-v2-2023-10-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-10-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-10-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-10-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json b/tools/foas/test/data/split/dev/openapi-v2-2023-11-15.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-11-15.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-11-15.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-11-15.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json b/tools/foas/test/data/split/dev/openapi-v2-2024-05-30.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json rename to tools/foas/test/data/split/dev/openapi-v2-2024-05-30.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml b/tools/foas/test/data/split/dev/openapi-v2-2024-05-30.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2024-05-30.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json b/tools/foas/test/data/split/dev/openapi-v2-2024-08-05.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json rename to tools/foas/test/data/split/dev/openapi-v2-2024-08-05.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml b/tools/foas/test/data/split/dev/openapi-v2-2024-08-05.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2024-08-05.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json b/tools/foas/test/data/split/dev/openapi-v2-2025-01-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2025-01-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2025-01-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2025-01-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2.json b/tools/foas/test/data/split/dev/openapi-v2.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2.json rename to tools/foas/test/data/split/dev/openapi-v2.json diff --git a/tools/cli/test/data/split/dev/openapi-v2.yaml b/tools/foas/test/data/split/dev/openapi-v2.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2.yaml rename to tools/foas/test/data/split/dev/openapi-v2.yaml diff --git a/tools/cli/test/data/split/download_specs.sh b/tools/foas/test/data/split/download_specs.sh similarity index 100% rename from tools/cli/test/data/split/download_specs.sh rename to tools/foas/test/data/split/download_specs.sh diff --git a/tools/cli/test/data/split/prod/README.md b/tools/foas/test/data/split/prod/README.md similarity index 100% rename from tools/cli/test/data/split/prod/README.md rename to tools/foas/test/data/split/prod/README.md diff --git a/tools/cli/test/data/split/prod/openapi-api-registry.json b/tools/foas/test/data/split/prod/openapi-api-registry.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-api-registry.json rename to tools/foas/test/data/split/prod/openapi-api-registry.json diff --git a/tools/cli/test/data/split/prod/openapi-mms.json b/tools/foas/test/data/split/prod/openapi-mms.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-mms.json rename to tools/foas/test/data/split/prod/openapi-mms.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-01-01.json b/tools/foas/test/data/split/prod/openapi-v2-2023-01-01.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-01-01.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-01-01.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-01-01.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-01-01.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-01-01.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-01-01.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-02-01.json b/tools/foas/test/data/split/prod/openapi-v2-2023-02-01.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-02-01.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-02-01.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-02-01.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-02-01.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-02-01.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-02-01.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-10-01.json b/tools/foas/test/data/split/prod/openapi-v2-2023-10-01.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-10-01.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-10-01.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-10-01.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-10-01.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-10-01.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-10-01.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-11-15.json b/tools/foas/test/data/split/prod/openapi-v2-2023-11-15.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-11-15.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-11-15.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-11-15.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-11-15.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-11-15.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-11-15.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-05-30.json b/tools/foas/test/data/split/prod/openapi-v2-2024-05-30.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-05-30.json rename to tools/foas/test/data/split/prod/openapi-v2-2024-05-30.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-05-30.yaml b/tools/foas/test/data/split/prod/openapi-v2-2024-05-30.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-05-30.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2024-05-30.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-08-05.json b/tools/foas/test/data/split/prod/openapi-v2-2024-08-05.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-08-05.json rename to tools/foas/test/data/split/prod/openapi-v2-2024-08-05.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-08-05.yaml b/tools/foas/test/data/split/prod/openapi-v2-2024-08-05.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-08-05.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2024-08-05.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2.json b/tools/foas/test/data/split/prod/openapi-v2.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2.json rename to tools/foas/test/data/split/prod/openapi-v2.json diff --git a/tools/cli/test/data/split/prod/openapi-v2.yaml b/tools/foas/test/data/split/prod/openapi-v2.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2.yaml rename to tools/foas/test/data/split/prod/openapi-v2.yaml