mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
Move OpenAPI spec from spec/ to openapi/
Naming a directory `spec` in a Ruby project is terribly ambiguous. This clarifies the purpose of this directory and makes it easier to find if you know that you're looking for OpenAPI.
This commit is contained in:
parent
3b193db847
commit
4d7019bee6
@ -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
|
||||
|
4
Rakefile
4
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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user