Module: OpenAPIParser

Defined in:
lib/openapi_parser.rb,
lib/openapi_parser/errors.rb,
lib/openapi_parser/version.rb

Defined Under Namespace

Modules: Expandable, Findable, Parseable, Schemas Classes: Config, NotAnyOf, NotEnumInclude, NotExistRequiredKey, NotNullError, OpenAPIError, ParameterValidator, PathItemFinder, ReferenceExpander, RequestOperation, SchemaValidator, ValidateError

Constant Summary collapse

VERSION =
'0.1.5'.freeze

Class Method Summary collapse

Class Method Details

.parse(schema, config = {}) ⇒ OpenAPIParser::Schemas::OpenAPI


17
18
19
20
21
22
23
24
# File 'lib/openapi_parser.rb', line 17

def parse(schema, config = {})
  c = Config.new(config)
  root = Schemas::OpenAPI.new(schema, c)

  OpenAPIParser::ReferenceExpander.expand(root) if c.expand_reference

  root
end