Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Joiful

Hierarchy

  • Joiful

Index

Constructors

constructor

  • new Joiful(options?: JoifulOptions): Joiful

Accessors

joi

  • get joi(): Root

Methods

any

array

boolean

date

func

getSchema

  • getSchema(Class: AnyClass): undefined | ObjectSchema<any>
  • Returns the Joi schema associated with a class or undefined if there isn't one.

    Parameters

    • Class: AnyClass

    Returns undefined | ObjectSchema<any>

hasSchema

  • hasSchema(Class: AnyClass): boolean
  • Returns whether the given class has a Joi schema associated with it

    Parameters

    • Class: AnyClass

    Returns boolean

link

  • Property decorator that constrains the property to another schema. This allows defining classes that reference themself. e.g.

    example

    class TreeNode {

    jf.string().required()

    title: string;

    jf.array().items((joi)

    => joi.link('...')) children: TreeNode[]; }

    Parameters

    • Optional ref: string

    Returns LinkSchemaDecorator

number

object

string

validateParams

  • validateParams(options?: { validator?: Validator }): MethodDecorator
  • Method decorator that validates the parameters passed into the method.

    Parameters

    Returns MethodDecorator

Generated using TypeDoc