Options
All
  • Public
  • Public/Protected
  • All
Menu

These are the options available for the JsonProperty annotation.

export
interface

JsonPropertyOptions

Hierarchy

  • JsonPropertyOptions

Index

Properties

Optional access

access: Access

It can be used to force Tyson to ignore this property during the serialization or deserialization process.

Optional ignoreType

ignoreType: undefined | true | false

Ignore the type of this property. This means that during the deserialization process the content of the json will be copied directly without any kind of check. The same thing during serialization. Default value: false

Optional name

name: undefined | string

Indicates the name of the key on the JSON, this is very useful if you need to have a different name on the class. Eg. If you mark your private property with "_"

Optional required

required: undefined | true | false

Property that indicates whether a value is expected for property during deserialization or not. If the value is missing on the JSON, an exception is thrown. Default value: false

Optional type

type: ClassType<any> | any[]

Specifies a type of the property. This is mandatory for arrays (single and multi-type). NOTE: if it's a Date object, you MUST specify the type!

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc