completecoding / serverless-auto-swagger

80 stars 48 forks source link

typescript union type definitions not reflecting properly in swagger models #83

Closed newtechfellas closed 2 years ago

newtechfellas commented 2 years ago

Given below type definitions in typescript: `export type HospitalCategory = "Allopathy" | "Homeopathy" | "Ayurveda" | "Naturopathy" | "Other";

export interface Hospital { name: string; email: string; phoneNumber: string; category: HospitalCategory; ... ... }` On generating swagger documentation, UI reflects incorrect type for category field. Is this expected?

Screen Shot 2022-07-25 at 9 40 59 PM
bfaulk96 commented 2 years ago

This is not the type, this is an "Example Value".

If you click on Model, it correctly shows the various options. This description is simply a view of a "possible response", which "Allopathy" is.