Options
All
  • Public
  • Public/Protected
  • All
Menu

Class which holds helper tools when working with ramls.

export
class

RamlUtil

Hierarchy

  • RamlUtil

Index

Methods

generateFakeData

  • generateFakeData(field: string, type: string, values?: string[]): string | number | boolean
  • Generate fake data for a field name

    Parameters

    • field: string

      field name

    • type: string

      data raml type: can be number / string / Boolean / date etc

    • Optional values: string[]

      default values for attributes (eg. enum: 'Yes' | 'No')

    Returns string | number | boolean

    fake data

generateId

  • generateId(type: string): number | string
  • Generate id/_id field value

    Parameters

    • type: string

      can be number / string / boolean

    Returns number | string

    random id

parseRamlValue

  • parseRamlValue(value: string, type: string): number | string | boolean
  • Parse object value to a custom raml type

    Parameters

    • value: string

      value to be parsed

    • type: string

      raml type

    Returns number | string | boolean

    parsed value

Generated using TypeDoc