diff --git a/README.md b/README.md index 2a099a1e..e63ef0b4 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ Update bundled CA certificates from the [Mozilla cURL release][curl]: Update bundled OpenAPI specification from the canonical repository: - bundle exec rake update_spec + bundle exec rake update_openapi [api-keys]: https://dashboard.stripe.com/account/apikeys [connect]: https://stripe.com/connect diff --git a/Rakefile b/Rakefile index 4ca5b869..614d44b3 100644 --- a/Rakefile +++ b/Rakefile @@ -15,13 +15,13 @@ task :update_certs do end desc "Update OpenAPI specification" -task :update_spec do +task :update_openapi do require "faraday" ["fixtures.json", "fixtures.yaml", "spec.json", "spec.yaml"].map { |file| Thread.new do fetch_file "https://raw.githubusercontent.com/stripe/openapi/master/spec/#{file}", - File.expand_path("../spec/#{file}", __FILE__) + File.expand_path("../openapi/#{file}", __FILE__) end }.map { |t| t.join } end diff --git a/spec/fixtures.json b/openapi/fixtures.json similarity index 100% rename from spec/fixtures.json rename to openapi/fixtures.json diff --git a/spec/fixtures.yaml b/openapi/fixtures.yaml similarity index 100% rename from spec/fixtures.yaml rename to openapi/fixtures.yaml diff --git a/spec/spec.json b/openapi/spec.json similarity index 100% rename from spec/spec.json rename to openapi/spec.json diff --git a/spec/spec.yaml b/openapi/spec.yaml similarity index 100% rename from spec/spec.yaml rename to openapi/spec.yaml diff --git a/test/api_fixtures.rb b/test/api_fixtures.rb index 1b769106..48b61a74 100644 --- a/test/api_fixtures.rb +++ b/test/api_fixtures.rb @@ -3,7 +3,7 @@ # tests. class APIFixtures def initialize - @fixtures = ::JSON.parse(File.read("#{PROJECT_ROOT}/spec/fixtures.json"), + @fixtures = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/fixtures.json"), symbolize_names: true) freeze_recursively(@fixtures) end diff --git a/test/api_stub_helpers.rb b/test/api_stub_helpers.rb index 811c4dca..f043060f 100644 --- a/test/api_stub_helpers.rb +++ b/test/api_stub_helpers.rb @@ -95,10 +95,10 @@ module APIStubHelpers end end - # Finds the latest OpenAPI specification in ROOT/spec/ and parses it for + # Finds the latest OpenAPI specification in ROOT/openapi/ and parses it for # use with Committee. def self.initialize_spec - schema_data = ::JSON.parse(File.read("#{PROJECT_ROOT}/spec/spec.json")) + schema_data = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/spec.json")) driver = Committee::Drivers::OpenAPI2.new driver.parse(schema_data)