Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
TypeScript - Class-Transformer: working with "type" keyword

On my Swagger Doc for a class, I'm trying to see a JSON schema output for my class.

My class, however, makes use of 2 "types"

export class PushNotification {
  name: string;   
  dir?: NotificationDirection;
  vibrate?: VibratePattern;
}

...

type NotificationDirection = 'auto' | 'ltr' | 'rtl';
type VibratePattern = number | number[];

On Swagger, on the schema, the key:value for "name" shows just fine, but the value appears blank for these other two variables.

How can I go about serializing these? I've been using class-transformer but I don't know if it works with "type"?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!