Module: Dry::Types::Builder
- Defined in:
- lib/dry/types/extensions/json_schema.rb
Overview
The ‘Builder` module provides a method to generate a JSON Schema hash from dry-types definitions.
Instance Method Summary collapse
Instance Method Details
#json_schema(options = {}) ⇒ Hash
317 318 319 320 321 |
# File 'lib/dry/types/extensions/json_schema.rb', line 317 def json_schema(root: false, loose: false) compiler = JSONSchema.new(root: root, loose: loose) compiler.call(to_ast) compiler.to_hash end |