Method: Fakeit::Openapi::Schema#to_example

Defined in:
lib/fakeit/openapi/schema.rb

#to_example(example_options) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/fakeit/openapi/schema.rb', line 13

def to_example(example_options)
  return example if example_options[:use_example] && example

  return one_of_example(example_options) if one_of
  return all_of_example(example_options) if all_of
  return any_of_example(example_options) if any_of

  type_based_example(example_options)
end