How to use the typedjson.jsonArrayMember function in typedjson

To help you get started, we’ve selected a few typedjson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opf / openproject / frontend / src / app / modules / bim / bcf / api / topics / bcf-topic.resource.ts View on Github external
@jsonObject
export class BcfTopicResource {

  @jsonMember
  guid:string;

  @jsonMember
  topic_type:string;

  @jsonMember
  topic_status:string;

  @jsonMember
  priority:string;

  @jsonArrayMember(String)
  reference_links:string[];

  @jsonMember
  title:string;

  @jsonMember({ preserveNull: true })
  index:number|null;

  @jsonArrayMember(String)
  labels:string[];

  @jsonMember({ deserializer: value => moment(value), serializer: (timestamp:Moment) => timestamp.toISOString() })
  creation_date:Moment;

  @jsonMember
  creation_author:string;
github opf / openproject / frontend / src / app / modules / bim / bcf / api / extensions / bcf-extension.resource.ts View on Github external
import { jsonArrayMember, jsonObject } from "typedjson";

@jsonObject
export class BcfExtensionResource {

  @jsonArrayMember(String)
  topic_actions:string[];

  @jsonArrayMember(String)
  project_actions:string[];

  @jsonArrayMember(String)
  comment_actions:string[];
}

typedjson

Typed JSON parsing and serializing for TypeScript that preserves type information, using decorators. Parse JSON into actual class instances.

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis