Module: Skooma::ExternalRefs

Included in:
Objects::Base, Objects::Schema
Defined in:
lib/skooma/external_refs.rb

Overview

External $ref resolution: upstream treats a referenced document as a single JSONSchema and errors out when the fragment points at a non-schema node inside a raw map (e.g. ‘responses.yaml#/Users`). Here we load the raw document, navigate to the fragment, and wrap the subtree as the referrer’s own class so OpenAPI semantics are preserved.

Instance Method Summary collapse

Instance Method Details

#resolve_ref(uri) ⇒ Object



10
11
12
13
14
# File 'lib/skooma/external_refs.rb', line 10

def resolve_ref(uri)
  super
rescue JSONSkooma::UnexpectedSchemaClassError
  load_external_ref(resolve_uri(uri))
end