typescript-rest-swagger icon indicating copy to clipboard operation
typescript-rest-swagger copied to clipboard

How to set examples on interfaces

Open adamf321 opened this issue 3 years ago • 1 comments

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;

adamf321 avatar Feb 01 '22 00:02 adamf321

+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;

thawankeane avatar Jun 29 '22 20:06 thawankeane