Class: OpenAPI::Loader::Collector

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/open_api/loader/collector.rb

Overview

Collects the schema from given [#source] file

  • loads the schema (and recursively loads and caches all its “$ref” files)

  • hashifies the schema to provide nested hash with stringified keys

  • collects the schema from the cached sources

Notice: The service is one-off because its instances cache variables:

`@uri` and `@path` (to provide absolute paths for `$ref`-s)
`@refs` (to minimize the number of remote file loading)

TODO: For now it doesn’t check that the graph of “$ref”-s has no cycles!

Instance Method Summary collapse

Instance Method Details

#callObject



24
25
26
# File 'lib/open_api/loader/collector.rb', line 24

def call
  build refs[""]
end