Module: Liminal::Openapi::SchemaResolver
- Defined in:
- lib/liminal/openapi/schema_resolver.rb
Class Method Summary collapse
Class Method Details
.call(source, **compile_options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/liminal/openapi/schema_resolver.rb', line 8 def call(source, **) schema = if source.is_a?(Hash) resolve_precompiled(source, ) elsif source.respond_to?(:to_ast) Liminal.compile(source, **) else raise InvalidSchemaSource, "Schema source must be a Hash or a dry-schema source responding to to_ast; " \ "received #{source.class}." end deep_freeze(schema) end |