Sha256: b8d65011946b59d01771976d50a2d69a5ca1c893293556772b3015ad73c64511
Contents?: true
Size: 800 Bytes
Versions: 7
Compression:
Stored size: 800 Bytes
Contents
module SoberSwag module Reporting module Compiler ## # Compile component schemas. class Schema def initialize @references = {} @referenced_schemas = Set.new end ## # Hash of references to type definitions. # Suitable for us as the components hash. attr_reader :references def compile(value) compile_inner(value.swagger_schema) end def compile_inner(value) initial, found = value merge_found(found) initial end def merge_found(found) found.each do |k, v| next unless @referenced_schemas.add?(k) @references[k] = compile_inner(v.call) end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems