Merge pull request #520 from stripe/brandur-update-openapi-conventions

Update some OpenAPI repository conventions
This commit is contained in:
Brandur 2017-03-23 17:29:46 -07:00 committed by GitHub
commit cb841602fa
7 changed files with 3762 additions and 3430 deletions

View File

@ -18,9 +18,9 @@ desc "Update OpenAPI specification"
task :update_openapi do
require "faraday"
["fixtures.json", "fixtures.yaml", "spec.json", "spec.yaml"].map { |file|
["fixtures.json", "fixtures.yaml", "spec2.json", "spec2.yaml"].map { |file|
Thread.new do
fetch_file "https://raw.githubusercontent.com/stripe/openapi/master/spec/#{file}",
fetch_file "https://raw.githubusercontent.com/stripe/openapi/master/openapi/#{file}",
File.expand_path("../openapi/#{file}", __FILE__)
end
}.map { |t| t.join }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
class APIFixtures
def initialize
@fixtures = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/fixtures.json"),
symbolize_names: true)
symbolize_names: true)[:resources]
freeze_recursively(@fixtures)
end

View File

@ -98,7 +98,7 @@ module APIStubHelpers
# Finds the latest OpenAPI specification in ROOT/openapi/ and parses it for
# use with Committee.
def self.initialize_spec
spec_data = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/spec.json"))
spec_data = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/spec2.json"))
driver = Committee::Drivers::OpenAPI2.new
driver.parse(spec_data)