thiagobustamante / typescript-rest-swagger

Swagger tools for typescript-rest
156 stars 57 forks source link

How to set examples on interfaces #147

Open adamf321 opened 2 years ago

adamf321 commented 2 years ago

Is there a way to use @Example on an interface, perhaps similar to how @IsInt works in the JSDoc?

Something like the docs doesn't work of course:

@Example...
effectiveDate?: Date;
thawankeane commented 2 years ago

+1

But I think that isn't possible at this moment.

The better aproach to this would be something like this:

/**
 * Effective date
 * @example "2022-06-29"
 */
effectiveDate?: Date;