From 2c389788e7d8761469a3f74b17d3ebd86425a1dc Mon Sep 17 00:00:00 2001 From: Brandur Date: Tue, 28 Apr 2020 11:27:41 -0700 Subject: [PATCH] Deprecate use of OpenAPI 2.0 (#55) Fully deprecates the use of OpenAPI 2.0 (we've noted in the README that it's been deprecated roughly ~forever) by: * No longer copying it or its fixtures out of our source directory. * Moving the existing files to a new `DEPRECATED_openapi` directory so that they're no longer part of the core set. * Updating the README to reflect the changes. --- {openapi => DEPECATED_openapi}/fixtures2.json | 0 {openapi => DEPECATED_openapi}/fixtures2.yaml | 0 {openapi => DEPECATED_openapi}/spec2.json | 0 {openapi => DEPECATED_openapi}/spec2.yaml | 0 README.md | 9 +++++++-- bin/update | 14 +++++++------- 6 files changed, 14 insertions(+), 9 deletions(-) rename {openapi => DEPECATED_openapi}/fixtures2.json (100%) rename {openapi => DEPECATED_openapi}/fixtures2.yaml (100%) rename {openapi => DEPECATED_openapi}/spec2.json (100%) rename {openapi => DEPECATED_openapi}/spec2.yaml (100%) diff --git a/openapi/fixtures2.json b/DEPECATED_openapi/fixtures2.json similarity index 100% rename from openapi/fixtures2.json rename to DEPECATED_openapi/fixtures2.json diff --git a/openapi/fixtures2.yaml b/DEPECATED_openapi/fixtures2.yaml similarity index 100% rename from openapi/fixtures2.yaml rename to DEPECATED_openapi/fixtures2.yaml diff --git a/openapi/spec2.json b/DEPECATED_openapi/spec2.json similarity index 100% rename from openapi/spec2.json rename to DEPECATED_openapi/spec2.json diff --git a/openapi/spec2.yaml b/DEPECATED_openapi/spec2.yaml similarity index 100% rename from openapi/spec2.yaml rename to DEPECATED_openapi/spec2.yaml diff --git a/README.md b/README.md index a20292fe..da4ac27f 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,15 @@ Files can be found in the `openapi/` directory: * Contains special annotations, deprecated endpoints, and pre-release features specifically intended to support generating Stripe API libraries. Users should use the `spec3.{json,yaml}` variant instead. -* `spec2.{json,yaml}`: OpenAPI 2.0 spec. We're continuing to generate this for - now, but it will be deprecated in favor of `spec3`. * `fixtures3.{json,yaml}`: Test fixtures for resources in `spec3`. See below for more information. + +We used to support OpenAPI 2.0, but have since deprecated its use, and it's no +longer receiving updates. It will still be available in `DEPRECATED_openapi` +for the next few months: + +* `spec2.{json,yaml}`: OpenAPI 2.0 spec. No longer receiving updates. + Deprecated in favor of `spec3`. * `fixtures2.{json,yaml}`: Test fixtures for resources in `spec2`. ## Vendor Extensions diff --git a/bin/update b/bin/update index de596971..9c80c4cd 100755 --- a/bin/update +++ b/bin/update @@ -101,7 +101,7 @@ class Updater out.puts "--> Pulling from origin" out.puts utils.git_pull_origin_master - ["fixtures2", "fixtures3", "spec2", "spec3", "spec3.sdk", "spec3.java.sdk"].each do |file| + ["fixtures3", "spec3", "spec3.sdk", "spec3.java.sdk"].each do |file| source = File.join(SOURCE_DIR, "openapi", file + ".yaml") target = File.join(TARGET_DIR, "openapi", file + ".yaml") @@ -172,7 +172,7 @@ else utils.expect(:git_pull_origin_master, "") - ["fixtures2", "fixtures3", "spec2", "spec3", "spec3.sdk", "spec3.java.sdk"].each do |file| + ["fixtures3", "spec3", "spec3.sdk", "spec3.java.sdk"].each do |file| source = File.join(Updater::SOURCE_DIR, "openapi", file + ".yaml") target = File.join(Updater::TARGET_DIR, "openapi", file + ".yaml") @@ -188,19 +188,19 @@ else [Updater::TARGET_DIR]) utils.expect(:dir_glob, - ["fixtures2.json", "fixtures2.yaml", "fixtures3.json", "fixtures3.yaml"], + ["fixtures3.json", "fixtures3.yaml"], ["#{Updater::TARGET_DIR}/openapi/fixtures*"]) utils.expect(:git_add, "", - [["fixtures2.json", "fixtures2.yaml", "fixtures3.json", "fixtures3.yaml"]]) + [["fixtures3.json", "fixtures3.yaml"]]) utils.expect(:git_any_files_staged?, true) utils.expect(:git_commit, "", ["Update fixture data"]) utils.expect(:dir_glob, - ["spec2.json", "spec2.yaml", "spec3.json", "spec3.yaml", "spec3.sdk.yaml", "spec3.sdk.json", "spec3.java.sdk.yaml", "spec3.java.sdk.json"], + ["spec3.json", "spec3.yaml", "spec3.sdk.yaml", "spec3.sdk.json", "spec3.java.sdk.yaml", "spec3.java.sdk.json"], ["#{Updater::TARGET_DIR}/openapi/spec*"]) utils.expect(:git_add, "", - [["spec2.json", "spec2.yaml", "spec3.json", "spec3.yaml", "spec3.sdk.yaml", "spec3.sdk.json", "spec3.java.sdk.yaml", "spec3.java.sdk.json"]]) + [["spec3.json", "spec3.yaml", "spec3.sdk.yaml", "spec3.sdk.json", "spec3.java.sdk.yaml", "spec3.java.sdk.json"]]) utils.expect(:git_any_files_staged?, true) utils.expect(:git_commit, "", ["Update OpenAPI specification"]) @@ -254,7 +254,7 @@ else utils.expect(:git_pull_origin_master, "") - ["fixtures2", "fixtures3", "spec2", "spec3", "spec3.sdk", "spec3.java.sdk"].each do |file| + ["fixtures3", "spec3", "spec3.sdk", "spec3.java.sdk"].each do |file| source = File.join(Updater::SOURCE_DIR, "openapi", file + ".yaml") target = File.join(Updater::TARGET_DIR, "openapi", file + ".yaml")