Sha256: f44db737ce6dd594c544dd2409fba9006834526e91c1c50ba1f0a0c48e975450
Contents?: true
Size: 599 Bytes
Versions: 11
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true require_relative '../schemas/dynamic_schema' module Meta module JsonSchema class DynamicSchemaBuilder def initialize(options) options = options.dup @dynamic_schema_options = options.delete(:dynamic_ref) @base_options = options end def to_schema DynamicSchema.new( @dynamic_schema_options[:resolve], one_of: @dynamic_schema_options[:one_of] && @dynamic_schema_options[:one_of].map { |schema| RefSchema.new(schema.to_schema) }, **@base_options ) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems