This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Book { | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
name: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
category: string; | |
} | |
class Writer { | |
@JsonProperty() @JsonClassType({type: () => [Number]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonProperty, JsonClassType, JsonAlias, ObjectMapper } from 'jackson-js'; | |
class Book { | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
name: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
@JsonAlias({values: ['bkcat', 'mybkcat']}) | |
category: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonProperty, JsonClassType, ObjectMapper, JsonAnyGetter } from 'jackson-js'; | |
class ScreenInfo { | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
id: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
title: string; | |
@JsonProperty() @JsonClassType({type: () => [Number]}) | |
width: number; | |
@JsonProperty() @JsonClassType({type: () => [Number]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonProperty, JsonClassType, ObjectMapper, JsonAnySetter } from 'jackson-js'; | |
class ScreenInfo { | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
id: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
title: string; | |
@JsonProperty() @JsonClassType({type: () => [Number]}) | |
width: number; | |
@JsonProperty() @JsonClassType({type: () => [Number]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonProperty, JsonClassType, ObjectMapper, JsonAppend } from 'jackson-js'; | |
@JsonAppend({attrs: [{ | |
value: 'version', | |
}]}) | |
class User { | |
@JsonProperty() @JsonClassType({type: () => [Number]}) | |
id: number; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
email: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonProperty, JsonClassType, ObjectMapper, JsonManagedReference, JsonBackReference } from 'jackson-js'; | |
class User { | |
@JsonProperty() @JsonClassType({type: () => [Number]}) | |
id: number; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
email: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
firstname: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonClassType } from 'jackson-js'; | |
class Foo2 { } | |
class Foo { | |
@JsonClassType({type: () => [Number]}) | |
barNumber: number; | |
@JsonClassType({type: () => [String]}) | |
barString: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonClassType, JsonProperty, JsonCreator, ObjectMapper } from 'jackson-js'; | |
class Employee { | |
@JsonProperty() @JsonClassType({type: () => [Number]}) | |
id: number; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
name: string; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
department: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonClassType, JsonProperty, ObjectMapper, JsonSerialize, JsonDeserialize } from 'jackson-js'; | |
class DateSerializer { | |
static serializeDate(date, context): any { | |
return { | |
year: date.getFullYear(), | |
month: date.getMonth() + 1, | |
day: date.getDate(), | |
formatted: date.toLocaleDateString() | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JsonClassType, JsonProperty, ObjectMapper, JsonFilter, JsonFilterType } from 'jackson-js'; | |
@JsonFilter({value: 'studentFilter'}) | |
class Student { | |
@JsonProperty({value: 'stdName'}) @JsonClassType({type: () => [String]}) | |
name: string; | |
@JsonProperty() @JsonClassType({type: () => [Number]}) | |
age: number; | |
@JsonProperty() @JsonClassType({type: () => [String]}) | |
college: string; |
OlderNewer