class JsonSchema::Schema

Public Instance Methods

make_example() click to toggle source
# File lib/json_schema-example_parsing.rb, line 21
def make_example
  if example
    return example
  end
  if items
    ex = items.make_example and return Array(ex)
  end
  unless any_of.empty?
    any_of.each {|s| ex = s.make_example and return ex }
  end
  unless all_of.empty?
    any_of.each {|s| ex = s.make_example and return ex }
  end
  nil
end