Skip to content

Commit

Permalink
Deprecate use of OpenAPI 2.0 (#55)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brandur committed Apr 28, 2020
1 parent e108788 commit 2c38978
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions bin/update
Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand All @@ -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"])
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 2c38978

Please sign in to comment.