repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
CoralineAda/seer | https://github.com/CoralineAda/seer/blob/2419e7a03a0cbf0c320b6cdfdcc902f6cf178709/lib/seer/pie_chart.rb | lib/seer/pie_chart.rb | module Seer
# =USAGE
#
# In your controller:
#
# @data = Widgets.all # Must be an array of objects that respond to the specidied data method
# # (In this example, 'quantity'
#
# In your view:
#
# <div id="chart"></div>
#
# <%= Seer::visualize(
# @data,
... | ruby | MIT | 2419e7a03a0cbf0c320b6cdfdcc902f6cf178709 | 2026-01-04T17:47:08.820980Z | false |
CoralineAda/seer | https://github.com/CoralineAda/seer/blob/2419e7a03a0cbf0c320b6cdfdcc902f6cf178709/lib/seer/area_chart.rb | lib/seer/area_chart.rb | module Seer
# =USAGE
#
# In your controller:
#
# @data = Widgets.all # Must be an array, and must respond
# # to the data method specified below (in this example, 'quantity')
#
# @series = @data.map{|w| w.widget_stats} # An array of arrays
#
# In your view:
#
# <div ... | ruby | MIT | 2419e7a03a0cbf0c320b6cdfdcc902f6cf178709 | 2026-01-04T17:47:08.820980Z | false |
CoralineAda/seer | https://github.com/CoralineAda/seer/blob/2419e7a03a0cbf0c320b6cdfdcc902f6cf178709/lib/seer/geomap.rb | lib/seer/geomap.rb | module Seer
# Geomap creates a map of a country, continent, or region, with colors and values assigned to
# specific regions. Values are displayed as a color scale, and you can specify optional hovertext
# for regions.
#
# =USAGE=
#
# In your view:
#
# <div id="my_geomap_container" class="chart">... | ruby | MIT | 2419e7a03a0cbf0c320b6cdfdcc902f6cf178709 | 2026-01-04T17:47:08.820980Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser_spec.rb | spec/openapi_parser_spec.rb | require_relative './spec_helper'
require 'uri'
require 'json'
require 'yaml'
require 'pathname'
RSpec.describe OpenAPIParser do
it 'has a version number' do
expect(OpenAPIParser::VERSION).not_to be nil
end
describe 'parse' do
it do
parsed = OpenAPIParser.parse(petstore_schema)
root = OpenAPI... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/spec_helper.rb | spec/spec_helper.rb | require 'bundler'
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("3.2.0")
require 'pry'
end
require 'rspec-parameterized'
require 'simplecov'
require 'psych'
SimpleCov.start do
add_filter 'spec'
end
SimpleCov.minimum_coverage 99
require 'openapi_parser'
RSpec.configure do |config|
# Enable flags l... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/path_item_ref_spec.rb | spec/openapi_parser/path_item_ref_spec.rb | require_relative '../spec_helper'
RSpec.describe 'path item $ref' do
let(:root) { OpenAPIParser.parse_with_filepath(
path_item_ref_schema, path_item_ref_schema_path, {})
}
let(:request_operation) { root.request_operation(:post, '/ref-sample') }
it 'understands path item $ref' do
ret = request_operatio... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator_spec.rb | spec/openapi_parser/schema_validator_spec.rb | require_relative '../spec_helper'
RSpec.describe OpenAPIParser::SchemaValidator do
let(:root) { OpenAPIParser.parse(normal_schema, config) }
let(:config) { {} }
describe 'validate_request_body' do
subject { request_operation.validate_request_body('application/json', params) }
let(:content_type) { 'appl... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/path_item_finder_spec.rb | spec/openapi_parser/path_item_finder_spec.rb | require_relative '../spec_helper'
RSpec.describe OpenAPIParser::PathItemFinder do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'parse_path_parameters' do
subject { OpenAPIParser::PathItemFinder.new(root.paths) }
it 'matches a single parameter with no additional characters' do
re... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/parameter_validator_spec.rb | spec/openapi_parser/parameter_validator_spec.rb | require_relative '../spec_helper'
RSpec.describe OpenAPIParser::ParameterValidator do
let(:root) { OpenAPIParser.parse(normal_schema, config) }
let(:config) { {} }
describe 'validate' do
subject { request_operation.validate_request_parameter(params, {}) }
let(:content_type) { 'application/json' }
l... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/request_operation_spec.rb | spec/openapi_parser/request_operation_spec.rb | require_relative '../spec_helper'
RSpec.describe OpenAPIParser::RequestOperation do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
let(:config) { OpenAPIParser::Config.new({}) }
let(:path_item_finder) { OpenAPIParser::PathItemFinder.new(root.paths) }
describe 'find' do
it 'no path items' do
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/concerns/findable_spec.rb | spec/openapi_parser/concerns/findable_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Findable do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'openapi object' do
subject { root }
it do
expect(subject.find_object('#/paths/~1pets/get').object_reference).to eq root.paths.path['/pets'].get.object_ref... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/concerns/media_type_selectable_spec.rb | spec/openapi_parser/concerns/media_type_selectable_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::MediaTypeSelectable do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe '#select_media_type(content_type, content)' do
subject { media_type_selectable.select_media_type(content_type) }
context '*/* exist' do
let(:pat... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/concerns/expandable_spec.rb | spec/openapi_parser/concerns/expandable_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Expandable do
let(:root) { OpenAPIParser.parse(normal_schema, {}) }
describe 'expand_reference' do
subject { root }
it do
subject
expect(subject.find_object('#/paths/~1reference/get/parameters/0').class).to eq OpenAPIParser::S... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/concerns/schema_loader/base_spec.rb | spec/openapi_parser/concerns/schema_loader/base_spec.rb | require_relative '../../../spec_helper'
RSpec.describe OpenAPIParser::SchemaLoader::Base do
describe '#load_data' do
subject { OpenAPIParser::SchemaLoader::Base.new(nil, {}).load_data(nil, nil) }
it { expect { subject }.to raise_error(StandardError).with_message('need implement') }
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/operation_spec.rb | spec/openapi_parser/schemas/operation_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Operation do
let(:root) { OpenAPIParser.parse(petstore_schema, { expand_reference: false }) }
describe '#init' do
subject { path_item.get }
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
it do
e... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/response_spec.rb | spec/openapi_parser/schemas/response_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Response do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'correct init' do
subject { responses.default }
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
let(:operation) { path_item.g... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/media_type_spec.rb | spec/openapi_parser/schemas/media_type_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::MediaType do
let(:root) { OpenAPIParser.parse(petstore_schema, { expand_reference: false }) }
describe 'correct init' do
subject { request_body.content['application/json'] }
let(:paths) { root.paths }
let(:path_item) { paths.... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/header_spec.rb | spec/openapi_parser/schemas/header_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Header do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'correct init' do
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
let(:operation) { path_item.get }
let(:response) { operation.r... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/path_item_spec.rb | spec/openapi_parser/schemas/path_item_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::PathItem do
let(:root) { OpenAPIParser.parse(normal_schema, {}) }
describe '#init' do
subject { path_item }
let(:paths) { root.paths }
let(:path_item) { paths.path['/characters'] }
it do
expect(subject).not_to be n... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/reference_spec.rb | spec/openapi_parser/schemas/reference_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Reference do
let(:root) { OpenAPIParser.parse(petstore_schema, { expand_reference: false }) }
describe 'correct init' do
subject { operation.parameters[2] }
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/paths_spec.rb | spec/openapi_parser/schemas/paths_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Paths do
let(:root) { OpenAPIParser.parse(normal_schema, {}) }
describe 'correct init' do
subject { root.paths }
it do
expect(subject).not_to be nil
expect(subject.object_reference).to eq '#/paths'
expect(subjec... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/schema_spec.rb | spec/openapi_parser/schemas/schema_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Schema do
let(:root) { OpenAPIParser.parse(petstore_schema, { expand_reference: false }) }
describe 'correct init' do
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
let(:operation) { path_item.get }
it... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/request_body_spec.rb | spec/openapi_parser/schemas/request_body_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::RequestBody do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'correct init' do
subject { operation.request_body }
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
let(:operation) { pat... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/polymorphism_spec.rb | spec/openapi_parser/schemas/polymorphism_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::RequestBody do
let(:content_type) { 'application/json' }
let(:http_method) { :post }
let(:request_path) { '/pet' }
let(:request_operation) { root.request_operation(http_method, request_path) }
let(:params) { {} }
context 'whith di... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/responses_spec.rb | spec/openapi_parser/schemas/responses_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Responses do
describe 'correct init' do
subject { operation.responses }
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
let(:operation) { path_i... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/discriminator_spec.rb | spec/openapi_parser/schemas/discriminator_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::RequestBody do
let(:root) { OpenAPIParser.parse(petstore_with_discriminator_schema, {}) }
describe 'discriminator' do
let(:content_type) { 'application/json' }
let(:http_method) { :post }
let(:request_path) { '/save_the_pets' ... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/components_spec.rb | spec/openapi_parser/schemas/components_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Components do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'correct init' do
subject { root.find_object('#/components') }
it do
expect(subject.root.object_id).to be root.object_id
expect(subject.cl... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/open_api_spec.rb | spec/openapi_parser/schemas/open_api_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::OpenAPI do
subject { OpenAPIParser.parse(petstore_schema, {}) }
describe 'init' do
it 'correct init' do
expect(subject).not_to be nil
expect(subject.root.object_id).to eq subject.object_id
end
end
describe '#opena... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/base_spec.rb | spec/openapi_parser/schemas/base_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Base do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'inspect' do
subject { root.inspect }
it { expect(subject).to eq '#' }
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schemas/parameter_spec.rb | spec/openapi_parser/schemas/parameter_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::Parameter do
let(:root) { OpenAPIParser.parse(petstore_schema, {}) }
describe 'correct init' do
subject { operation.parameters.first }
let(:paths) { root.paths }
let(:path_item) { paths.path['/pets'] }
let(:operation) { p... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator/array_validator_spec.rb | spec/openapi_parser/schema_validator/array_validator_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::SchemaValidator::ArrayValidator do
let(:replace_schema) { {} }
let(:root) { OpenAPIParser.parse(build_validate_test_schema(replace_schema), config) }
let(:config) { {} }
let(:target_schema) do
root.paths.path['/validate_test'].operation(:po... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator/integer_validator_spec.rb | spec/openapi_parser/schema_validator/integer_validator_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::SchemaValidator::IntegerValidator do
let(:replace_schema) { {} }
let(:root) { OpenAPIParser.parse(build_validate_test_schema(replace_schema), config) }
let(:config) { {} }
let(:target_schema) do
root.paths.path['/validate_test'].operation(:... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator/base_spec.rb | spec/openapi_parser/schema_validator/base_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::SchemaValidator::Base do
describe '#coerce_and_validate(_value, _schema)' do
subject { OpenAPIParser::SchemaValidator::Base.new(nil, nil).coerce_and_validate(nil, nil) }
it { expect { subject }.to raise_error(StandardError).with_message('nee... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator/all_of_validator_spec.rb | spec/openapi_parser/schema_validator/all_of_validator_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::Schemas::RequestBody do
let(:root) { OpenAPIParser.parse(petstore_with_discriminator_schema, {}) }
describe 'allOf nested objects' do
let(:content_type) { 'application/json' }
let(:http_method) { :post }
let(:request_path) { '/save_the... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator/string_validator_spec.rb | spec/openapi_parser/schema_validator/string_validator_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::SchemaValidator::StringValidator do
let(:replace_schema) { {} }
let(:root) { OpenAPIParser.parse(build_validate_test_schema(replace_schema), config) }
let(:config) { {} }
let(:target_schema) do
root.paths.path['/validate_test'].operation(:p... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/spec/openapi_parser/schema_validator/object_validator_spec.rb | spec/openapi_parser/schema_validator/object_validator_spec.rb | require_relative '../../spec_helper'
RSpec.describe OpenAPIParser::SchemaValidator::ObjectValidator do
before do
@validator = OpenAPIParser::SchemaValidator::ObjectValidator.new(nil, nil)
@root = OpenAPIParser.parse(
'openapi' => '3.0.0',
'components' => {
'schemas' => {
'object... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser.rb | lib/openapi_parser.rb | require 'uri'
require 'time'
require 'json'
require 'psych'
require 'pathname'
require 'open-uri'
require 'openapi_parser/version'
require 'openapi_parser/config'
require 'openapi_parser/errors'
require 'openapi_parser/concern'
require 'openapi_parser/schemas'
require 'openapi_parser/path_item_finder'
require 'openapi... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/reference_expander.rb | lib/openapi_parser/reference_expander.rb | class OpenAPIParser::ReferenceExpander
class << self
# @param [OpenAPIParser::Schemas::OpenAPI] openapi
def expand(openapi, validate_references)
openapi.expand_reference(openapi, validate_references)
openapi.purge_object_cache
end
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/version.rb | lib/openapi_parser/version.rb | module OpenAPIParser
VERSION = '2.3.1'.freeze
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/errors.rb | lib/openapi_parser/errors.rb | module OpenAPIParser
class OpenAPIError < StandardError
def initialize(reference)
@reference = reference
end
end
class MissingReferenceError < OpenAPIError
def message
"'#{@reference}' was referenced but could not be found"
end
end
class ValidateError < OpenAPIError
def initi... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator.rb | lib/openapi_parser/schema_validator.rb | require_relative 'schema_validator/options'
require_relative 'schema_validator/enumable'
require_relative 'schema_validator/minimum_maximum'
require_relative 'schema_validator/properties_number'
require_relative 'schema_validator/base'
require_relative 'schema_validator/string_validator'
require_relative 'schema_valida... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas.rb | lib/openapi_parser/schemas.rb | require_relative 'schemas/classes'
require_relative 'schemas/base'
require_relative 'schemas/discriminator'
require_relative 'schemas/openapi'
require_relative 'schemas/paths'
require_relative 'schemas/path_item'
require_relative 'schemas/operation'
require_relative 'schemas/parameter'
require_relative 'schemas/refere... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concern.rb | lib/openapi_parser/concern.rb | require_relative 'concerns/parser'
require_relative 'concerns/findable'
require_relative 'concerns/expandable'
require_relative 'concerns/media_type_selectable'
require_relative 'concerns/parameter_validatable'
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/config.rb | lib/openapi_parser/config.rb | class OpenAPIParser::Config
def initialize(config)
# TODO: This deprecation warning can be removed after we set the default to `true`
# in a later (major?) version update.
unless config.key?(:strict_reference_validation)
msg = "[DEPRECATION] strict_reference_validation config is not set. It defaults... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/request_operation.rb | lib/openapi_parser/request_operation.rb | # binding request data and operation object
class OpenAPIParser::RequestOperation
class << self
# @param [OpenAPIParser::Config] config
# @param [OpenAPIParser::PathItemFinder] path_item_finder
# @return [OpenAPIParser::RequestOperation, nil]
def create(http_method, request_path, path_item_finder, co... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/path_item_finder.rb | lib/openapi_parser/path_item_finder.rb | class OpenAPIParser::PathItemFinder
# @param [OpenAPIParser::Schemas::Paths] paths
def initialize(paths)
@paths = paths
end
# find operation object and if not exist return nil
# @param [String, Symbol] http_method like (get, post .... allow symbol)
# @param [String] request_path
# @return [Result, ni... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/parameter_validator.rb | lib/openapi_parser/parameter_validator.rb | class OpenAPIParser::ParameterValidator
class << self
# @param [Hash{String => Parameter}] parameters_hash
# @param [Hash] params
# @param [String] object_reference
# @param [OpenAPIParser::SchemaValidator::Options] options
# @param [Boolean] is_header is header or not (ignore params key case)
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/expandable.rb | lib/openapi_parser/concerns/expandable.rb | module OpenAPIParser::Expandable
# expand refs
# @param [OpenAPIParser::Schemas::Base] root
# @return nil
def expand_reference(root, validate_references)
expand_list_objects(root, self.class._openapi_attr_list_objects.keys, validate_references)
expand_objects(root, self.class._openapi_attr_objects.keys,... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser.rb | lib/openapi_parser/concerns/parser.rb | module OpenAPIParser::Parser
end
require 'forwardable'
require_relative './parser/core'
require_relative './schema_loader'
module OpenAPIParser::Parser
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
extend Forwardable
def_delegators :_parser_core, :_openapi_attr_values, ... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/media_type_selectable.rb | lib/openapi_parser/concerns/media_type_selectable.rb | module OpenAPIParser::MediaTypeSelectable
private
# select media type by content_type (consider wild card definition)
# @param [String] content_type
# @param [Hash{String => OpenAPIParser::Schemas::MediaType}] content
# @return [OpenAPIParser::Schemas::MediaType, nil]
def select_media_type_from_c... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/findable.rb | lib/openapi_parser/concerns/findable.rb | require 'cgi'
require 'uri'
module OpenAPIParser::Findable
# @param [String] reference
# @return [OpenAPIParser::Findable]
def find_object(reference)
return self if object_reference == reference
remote_reference = !reference.start_with?('#')
return find_remote_object(reference) if remote_reference
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parameter_validatable.rb | lib/openapi_parser/concerns/parameter_validatable.rb | module OpenAPIParser::ParameterValidatable
# @param [Hash] path_params path parameters
# @param [OpenAPIParser::SchemaValidator::Options] options request validator options
def validate_path_params(path_params, options)
OpenAPIParser::ParameterValidator.validate_parameter(path_parameter_hash, path_params, obje... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader.rb | lib/openapi_parser/concerns/schema_loader.rb | class OpenAPIParser::SchemaLoader
end
require_relative './schema_loader/base'
require_relative './schema_loader/creator'
require_relative './schema_loader/values_loader'
require_relative './schema_loader/list_loader'
require_relative './schema_loader/objects_loader'
require_relative './schema_loader/hash_objects_loade... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/creator.rb | lib/openapi_parser/concerns/schema_loader/creator.rb | # loader base class for create OpenAPI::Schemas::Base object
class OpenAPIParser::SchemaLoader::Creator < OpenAPIParser::SchemaLoader::Base
# @param [String] variable_name
# @param [Hash] options
def initialize(variable_name, options)
super(variable_name, options)
@klass = options[:klass]
@allow_refe... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/values_loader.rb | lib/openapi_parser/concerns/schema_loader/values_loader.rb | # data type values loader
class OpenAPIParser::SchemaLoader::ValuesLoader < OpenAPIParser::SchemaLoader::Base
# @param [OpenAPIParser::Schemas::Base] target_object
# @param [Hash] raw_schema
# @return [Array<OpenAPIParser::Schemas::Base>, nil]
def load_data(target_object, raw_schema)
variable_set(target_obj... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/list_loader.rb | lib/openapi_parser/concerns/schema_loader/list_loader.rb | # list object loader
class OpenAPIParser::SchemaLoader::ListLoader < OpenAPIParser::SchemaLoader::Creator
# @param [OpenAPIParser::Schemas::Base] target_object
# @param [Hash] raw_schema
# @return [Array<OpenAPIParser::Schemas::Base>, nil]
def load_data(target_object, raw_schema)
create_attr_list_object(tar... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/hash_body_loader.rb | lib/openapi_parser/concerns/schema_loader/hash_body_loader.rb | # hash body object loader
class OpenAPIParser::SchemaLoader::HashBodyLoader < OpenAPIParser::SchemaLoader::Creator
# @param [String] variable_name
# @param [Hash] options
def initialize(variable_name, options)
super(variable_name, options)
@reject_keys = options[:reject_keys] ? options[:reject_keys].map(... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/base.rb | lib/openapi_parser/concerns/schema_loader/base.rb | # loader base class
class OpenAPIParser::SchemaLoader::Base
# @param [String] variable_name
# @param [Hash] options
def initialize(variable_name, options)
@variable_name = variable_name
@schema_key = options[:schema_key] || variable_name
end
# @param [OpenAPIParser::Schemas::Base] _target_object
# ... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/hash_objects_loader.rb | lib/openapi_parser/concerns/schema_loader/hash_objects_loader.rb | # hash object loader
class OpenAPIParser::SchemaLoader::HashObjectsLoader < OpenAPIParser::SchemaLoader::Creator
# @param [OpenAPIParser::Schemas::Base] target_object
# @param [Hash] raw_schema
# @return [Array<OpenAPIParser::Schemas::Base>, nil]
def load_data(target_object, raw_schema)
create_attr_hash_obj... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/schema_loader/objects_loader.rb | lib/openapi_parser/concerns/schema_loader/objects_loader.rb | # Specific Object loader (defined by klass option)
class OpenAPIParser::SchemaLoader::ObjectsLoader < OpenAPIParser::SchemaLoader::Creator
# @param [OpenAPIParser::Schemas::Base] target_object
# @param [Hash] raw_schema
# @return [Array<OpenAPIParser::Schemas::Base>, nil]
def load_data(target_object, raw_schema... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser/core.rb | lib/openapi_parser/concerns/parser/core.rb | require_relative './value'
require_relative './object'
require_relative './list'
require_relative './hash'
require_relative './hash_body'
class OpenAPIParser::Parser::Core
include OpenAPIParser::Parser::Value
include OpenAPIParser::Parser::Object
include OpenAPIParser::Parser::List
include OpenAPIParser::Parse... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser/value.rb | lib/openapi_parser/concerns/parser/value.rb | module OpenAPIParser::Parser::Value
def _openapi_attr_values
@_openapi_attr_values ||= {}
end
def openapi_attr_values(*names)
names.each { |name| openapi_attr_value(name) }
end
def openapi_attr_value(name, options = {})
target_klass.send(:attr_reader, name)
_openapi_attr_values[name] = OpenA... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser/object.rb | lib/openapi_parser/concerns/parser/object.rb | module OpenAPIParser::Parser::Object
def _openapi_attr_objects
@_openapi_attr_objects ||= {}
end
def openapi_attr_objects(*names, klass)
names.each { |name| openapi_attr_object(name, klass) }
end
def openapi_attr_object(name, klass, options = {})
target_klass.send(:attr_reader, name)
_openap... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser/list.rb | lib/openapi_parser/concerns/parser/list.rb | module OpenAPIParser::Parser::List
def _openapi_attr_list_objects
@_openapi_attr_list_objects ||= {}
end
def openapi_attr_list_object(name, klass, options = {})
target_klass.send(:attr_reader, name)
_openapi_attr_list_objects[name] = OpenAPIParser::SchemaLoader::ListLoader.new(name, options.merge(kla... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser/hash_body.rb | lib/openapi_parser/concerns/parser/hash_body.rb | module OpenAPIParser::Parser::HashBody
def _openapi_attr_hash_body_objects
@_openapi_attr_hash_body_objects ||= {}
end
def openapi_attr_hash_body_objects(name, klass, options = {})
# options[:reject_keys] = options[:reject_keys] ? options[:reject_keys].map(&:to_s) : []
target_klass.send(:attr_reader... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/concerns/parser/hash.rb | lib/openapi_parser/concerns/parser/hash.rb | module OpenAPIParser::Parser::Hash
def _openapi_attr_hash_objects
@_openapi_attr_hash_objects ||= {}
end
def openapi_attr_hash_object(name, klass, options = {})
target_klass.send(:attr_reader, name)
_openapi_attr_hash_objects[name] = ::OpenAPIParser::SchemaLoader::HashObjectsLoader.new(name, options.... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/reference.rb | lib/openapi_parser/schemas/reference.rb | module OpenAPIParser::Schemas
class Reference < Base
# @!attribute [r] ref
# @return [Base]
openapi_attr_value :ref, schema_key: '$ref'
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/path_item.rb | lib/openapi_parser/schemas/path_item.rb | # TODO: support servers
# TODO: support reference
module OpenAPIParser::Schemas
class PathItem < Base
openapi_attr_values :summary, :description
openapi_attr_objects :get, :put, :post, :delete, :options, :head, :patch, :trace, Operation
openapi_attr_list_object :parameters, Parameter, reference: true
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/discriminator.rb | lib/openapi_parser/schemas/discriminator.rb | module OpenAPIParser::Schemas
class Discriminator < Base
# @!attribute [r] property_name
# @return [String, nil]
openapi_attr_value :property_name, schema_key: :propertyName
# @!attribute [r] mapping
# @return [Hash{String => String]
openapi_attr_value :mapping
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/parameter.rb | lib/openapi_parser/schemas/parameter.rb | # TODO: support examples
module OpenAPIParser::Schemas
class Parameter < Base
openapi_attr_values :name, :in, :description, :required, :deprecated, :style, :explode, :example
openapi_attr_value :allow_empty_value, schema_key: :allowEmptyValue
openapi_attr_value :allow_reserved, schema_key: :allowReserve... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/responses.rb | lib/openapi_parser/schemas/responses.rb | # TODO: support extended property
module OpenAPIParser::Schemas
class Responses < Base
# @!attribute [r] default
# @return [Response, Reference, nil] default response object
openapi_attr_object :default, Response, reference: true
# @!attribute [r] response
# @return [Hash{String => Response,... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/response.rb | lib/openapi_parser/schemas/response.rb | # TODO: links
module OpenAPIParser::Schemas
class Response < Base
include OpenAPIParser::MediaTypeSelectable
openapi_attr_values :description
# @!attribute [r] content
# @return [Hash{String => MediaType}, nil] content_type to MediaType hash
openapi_attr_hash_object :content, MediaType, refer... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/components.rb | lib/openapi_parser/schemas/components.rb | # TODO: examples
# TODO: securitySchemes
# TODO: links
# TODO: callbacks
module OpenAPIParser::Schemas
class Components < Base
# @!attribute [r] parameters
# @return [Hash{String => Parameter}, nil]
openapi_attr_hash_object :parameters, Parameter, reference: true
# @!attribute [r] parameters
#... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/classes.rb | lib/openapi_parser/schemas/classes.rb | # We want to use class name for DSL in class definition so we should define first...
module OpenAPIParser::Schemas
class Base; end
class Discriminator < Base; end
class OpenAPI < Base; end
class Operation < Base; end
class Parameter < Base; end
class PathItem < Base; end
class Paths < Base; end
class R... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/paths.rb | lib/openapi_parser/schemas/paths.rb | module OpenAPIParser::Schemas
class Paths < Base
# @!attribute [r] path
# @return [Hash{String => PathItem, Reference}, nil]
openapi_attr_hash_body_objects 'path', PathItem, reference: true, allow_data_type: false
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/base.rb | lib/openapi_parser/schemas/base.rb | module OpenAPIParser::Schemas
class Base
include OpenAPIParser::Parser
include OpenAPIParser::Findable
include OpenAPIParser::Expandable
attr_reader :parent, :raw_schema, :object_reference, :root
# @param [OpenAPIParser::Schemas::Base]
def initialize(object_reference, parent, root, raw_schem... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/info.rb | lib/openapi_parser/schemas/info.rb | module OpenAPIParser::Schemas
class Info < Base
openapi_attr_values :title, :version
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/media_type.rb | lib/openapi_parser/schemas/media_type.rb | # TODO: example
# TODO: examples
# TODO: encoding
module OpenAPIParser::Schemas
class MediaType < Base
# @!attribute [r] schema
# @return [Schema, nil] OpenAPI3 Schema object
openapi_attr_object :schema, Schema, reference: true
# validate params by schema definitions
# @param [Hash] params
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/request_body.rb | lib/openapi_parser/schemas/request_body.rb | # TODO: support extended property
module OpenAPIParser::Schemas
class RequestBody < Base
include OpenAPIParser::MediaTypeSelectable
# @!attribute [r] description
# @return [String] description data
# @!attribute [r] required
# @return [Boolean] required bool data
openapi_attr_values :des... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/operation.rb | lib/openapi_parser/schemas/operation.rb | # TODO: externalDocs
# TODO: callbacks
# TODO: security
# TODO: servers
module OpenAPIParser::Schemas
class Operation < Base
include OpenAPIParser::ParameterValidatable
openapi_attr_values :tags, :summary, :description, :deprecated
openapi_attr_value :operation_id, schema_key: :operationId
openapi... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/header.rb | lib/openapi_parser/schemas/header.rb | module OpenAPIParser::Schemas
class Header < Base
openapi_attr_values :description, :required, :deprecated, :style, :explode, :example
openapi_attr_value :allow_empty_value, schema_key: :allowEmptyValue
openapi_attr_value :allow_reserved, schema_key: :allowReserved
# @!attribute [r] schema
# @... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/openapi.rb | lib/openapi_parser/schemas/openapi.rb | # TODO: info object
# TODO: servers object
# TODO: tags object
# TODO: externalDocs object
module OpenAPIParser::Schemas
class OpenAPI < Base
def initialize(raw_schema, config, uri: nil, schema_registry: {})
super('#', nil, self, raw_schema)
@find_object_cache = {}
@path_item_finder = OpenAPIPa... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schemas/schema.rb | lib/openapi_parser/schemas/schema.rb | # TODO: support 'not' because I need check reference...
# TODO: support 'xml', 'externalDocs'
# TODO: support extended property
module OpenAPIParser::Schemas
class Schema < Base
# @!attribute [r] title
# @return [String, nil]
# @!attribute [r] pattern
# @return [String, nil] regexp
# @!attrib... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/all_of_validator.rb | lib/openapi_parser/schema_validator/all_of_validator.rb | # validate AllOf schema
class OpenAPIParser::SchemaValidator
class AllOfValidator < Base
# coerce and validate value
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce_and_validate(value, schema, **keyword_args)
if value.nil? && schema.nullable
return [va... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/enumable.rb | lib/openapi_parser/schema_validator/enumable.rb | class OpenAPIParser::SchemaValidator
module Enumable
# check enum value by schema
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def check_enum_include(value, schema)
return [value, nil] unless schema.enum
return [value, nil] if schema.enum.include?(value)
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/minimum_maximum.rb | lib/openapi_parser/schema_validator/minimum_maximum.rb | class OpenAPIParser::SchemaValidator
module MinimumMaximum
# check minimum and maximum value by schema
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def check_minimum_maximum(value, schema)
include_min_max = schema.minimum || schema.maximum
return [value, nil] un... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/nil_validator.rb | lib/openapi_parser/schema_validator/nil_validator.rb | class OpenAPIParser::SchemaValidator
class NilValidator < Base
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce_and_validate(value, schema, **_keyword_args)
return [value, nil] if schema.nullable
[nil, OpenAPIParser::NotNullError.new(schema.object_reference)... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/unspecified_type_validator.rb | lib/openapi_parser/schema_validator/unspecified_type_validator.rb | class OpenAPIParser::SchemaValidator
class UnspecifiedTypeValidator < Base
# @param [Object] value
def coerce_and_validate(value, _schema, **_keyword_args)
[value, nil]
end
end
end
| ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/options.rb | lib/openapi_parser/schema_validator/options.rb | class OpenAPIParser::SchemaValidator
class Options
# @!attribute [r] allow_empty_date_and_datetime
# @return [Boolean] allow empty date and datetime values option on/off
# @!attribute [r] coerce_value
# @return [Boolean] coerce value option on/off
# @!attribute [r] datetime_coerce_class
# ... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/array_validator.rb | lib/openapi_parser/schema_validator/array_validator.rb | class OpenAPIParser::SchemaValidator
class ArrayValidator < Base
# @param [Array] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce_and_validate(value, schema, **_keyword_args)
return OpenAPIParser::ValidateError.build_error_result(value, schema) unless value.kind_of?(Array)
v... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/base.rb | lib/openapi_parser/schema_validator/base.rb | class OpenAPIParser::SchemaValidator
class Base
def initialize(validatable, coerce_value)
@validatable = validatable
@coerce_value = coerce_value
end
attr_reader :validatable
# need override
def coerce_and_validate(_value, _schema, **_keyword_args)
raise 'need implement'
en... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/integer_validator.rb | lib/openapi_parser/schema_validator/integer_validator.rb | class OpenAPIParser::SchemaValidator
class IntegerValidator < Base
include ::OpenAPIParser::SchemaValidator::Enumable
include ::OpenAPIParser::SchemaValidator::MinimumMaximum
# validate integer value by schema
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/object_validator.rb | lib/openapi_parser/schema_validator/object_validator.rb | class OpenAPIParser::SchemaValidator
class ObjectValidator < Base
include ::OpenAPIParser::SchemaValidator::PropertiesNumber
# @param [Hash] value
# @param [OpenAPIParser::Schemas::Schema] schema
# @param [Boolean] parent_all_of true if component is nested under allOf
# @param [String, nil] discr... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/any_of_validator.rb | lib/openapi_parser/schema_validator/any_of_validator.rb | class OpenAPIParser::SchemaValidator
class AnyOfValidator < Base
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce_and_validate(value, schema, **_keyword_args)
if value.nil? && schema.nullable
return [value, nil]
end
if schema.discriminator
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/properties_number.rb | lib/openapi_parser/schema_validator/properties_number.rb | class OpenAPIParser::SchemaValidator
module PropertiesNumber
# check minProperties and manProperties value by schema
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def check_properties_number(value, schema)
include_properties_num = schema.minProperties || schema.maxProp... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/float_validator.rb | lib/openapi_parser/schema_validator/float_validator.rb | class OpenAPIParser::SchemaValidator
class FloatValidator < Base
include ::OpenAPIParser::SchemaValidator::Enumable
include ::OpenAPIParser::SchemaValidator::MinimumMaximum
# validate float value by schema
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce_and... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/string_validator.rb | lib/openapi_parser/schema_validator/string_validator.rb | class OpenAPIParser::SchemaValidator
class StringValidator < Base
include ::OpenAPIParser::SchemaValidator::Enumable
def initialize(validator, allow_empty_date_and_datetime, coerce_value, datetime_coerce_class, date_coerce_class)
super(validator, coerce_value)
@allow_empty_date_and_datetime = all... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/one_of_validator.rb | lib/openapi_parser/schema_validator/one_of_validator.rb | class OpenAPIParser::SchemaValidator
class OneOfValidator < Base
# @param [Object] value
# @param [OpenAPIParser::Schemas::Schema] schema
def coerce_and_validate(value, schema, **_keyword_args)
if value.nil? && schema.nullable
return [value, nil]
end
if schema.discriminator
... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
ota42y/openapi_parser | https://github.com/ota42y/openapi_parser/blob/e05fcd720c2c4dcaabe39c9f12c8384f3730294a/lib/openapi_parser/schema_validator/boolean_validator.rb | lib/openapi_parser/schema_validator/boolean_validator.rb | class OpenAPIParser::SchemaValidator
class BooleanValidator < Base
include ::OpenAPIParser::SchemaValidator::Enumable
TRUE_VALUES = ['true', '1'].freeze
FALSE_VALUES = ['false', '0'].freeze
def coerce_and_validate(value, schema, **_keyword_args)
value = coerce(value) if @coerce_value
re... | ruby | MIT | e05fcd720c2c4dcaabe39c9f12c8384f3730294a | 2026-01-04T17:47:05.849147Z | false |
prognostikos/cb2 | https://github.com/prognostikos/cb2/blob/338cb29d8154a07128501044175eb90e087a7a00/spec/breaker_spec.rb | spec/breaker_spec.rb | require "spec_helper"
describe CB2::Breaker do
let(:breaker) do
CB2::Breaker.new(
strategy: :stub,
allow: false)
end
describe "#run" do
it "raises when the breaker is open" do
assert_raises(CB2::BreakerOpen) do
breaker.run { 1+1 }
end
end
it "returns the origi... | ruby | MIT | 338cb29d8154a07128501044175eb90e087a7a00 | 2026-01-04T17:47:11.173474Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.