Class ExampleBuilderBaseAbstract

ExampleBuilder generates examples from OpenAPIV3.ReferenceObject of OpenAPIV3.SchemaObject with auto detect examples, default value, enum value

if value has example it returns example

if value has default type instead example it returns default value

if value is enum, it returns first possible value

if value is integer returns 0

if value is boolean returns false

if value is string returns "string"

Hierarchy

Constructors

Properties

_options?: IRavageOptions

Methods

  • Build example with object type with recursive DFS algorithm on graph with nodes OpenAPIV3.ReferenceObject or OpenAPIV3.SchemaObject

    Parameters

    Returns Promise<object>

  • Generates JSON string with indent for Content block example

    Parameters

    Returns Promise<string>

  • Get schema from openapi.components.schemas, if obj is OpenAPIV3.SchemaObject it returns obj, otherwise it search OpenAPIV3.SchemaObject

    Parameters

    Returns Promise<SchemaObject>

  • Build example and returns Content block with indent

    Parameters

    Returns Promise<Content>

Generated using TypeDoc