Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface JsonStringifierContext

Context properties used by JsonStringifier.stringify during serialization.

Hierarchy

Index

Properties

Optional attributes

attributes: {}

An Object Literal containing attributes values to be assigned during serialization for JsonAppend attributes.

Type declaration

  • [key: string]: any

Optional dateLibrary

dateLibrary: any

To be able to use JsonFormat on class properties of type Date with JsonFormatShape.STRING, a date library needs to be set. Date libraries supported: https://github.com/moment/moment, https://github.com/iamkun/dayjs/.

Optional decoratorsEnabled

decoratorsEnabled: {}

Property whose keys are the decorators name that will be enabled/disabled during serialization/deserialization.

Type declaration

  • [key: string]: boolean

Optional features

features: { serialization: SerializationFeature }

Property that defines features to set for ObjectMapper and JsonStringifier.

Type declaration

Optional filters

filters: {}

An Object Literal containing filter options used by JsonFilter during serialization. Object keys are simple string that refers to the name of the corresponding JsonFilterOptions.value.

Type declaration

Optional forType

Property whose keys are JavaScript Classes and its values are contexts to be used only for that JavaScript Classes.

More specific contexts can be nested one inside the other. In this way, specific contexts can be applied to a JavaScript Class only if the nested JavaScript Class is found as one of the values of the parent JavaScript Class properties.

Optional format

format: string | number

A String or Number object that's used to insert white space into the output JSON string for readability purposes.

If this is a Number, it indicates the number of space characters to use as white space; this number is capped at 10 (if it is greater, the value is just 10). Values less than 1 indicate that no space should be used.

If this is a String, the string (or the first 10 characters of the string, if it's longer than that) is used as white space. If this parameter is not provided (or is null), no white space is used.

Optional mainCreator

mainCreator: () => ClassList<ClassType<any>>

Function that returns a list of JavaScript Classes.

returns

ClassList<ClassType>

Type declaration

Optional serializers

serializers: CustomMapper<Serializer>[]

Array of custom user-defined serializers.

Optional uuidLibrary

uuidLibrary: any

To be able to use JsonIdentityInfo with any UUID ObjectIdGenerator, an UUID library needs to be set. UUID libraries supported: https://github.com/uuidjs/uuid.

Optional withContextGroups

withContextGroups: string[]

List of context groups used to serialize/deserialize JSON objects.

Optional withViews

withViews: () => ClassType<any>[]

List of views (see JsonView) used to serialize/deserialize JSON objects.

Type declaration

Generated using TypeDoc