Module: Fakeit::Openapi::Schema

Includes:
Example
Included in:
OpenAPIParser::Schemas::Schema
Defined in:
lib/fakeit/openapi/schema.rb

Constant Summary

Constants included from Example

Example::DEFAULT_BITS, Example::MAX_NUM, Example::MIN_NUM, Example::RANDOM_FORMAT_HANDLERS, Example::STATIC_FORMAT_HANDLERS

Instance Method Summary collapse

Methods included from Example

#array_example, #boolean_example, #integer_example, #number_example, #object_example, #string_example

Instance Method Details

#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