Skip to content

Instantly share code, notes, and snippets.

View rashgaroth's full-sized avatar
🤔
Thinking

Rashgaroth rashgaroth

🤔
Thinking
View GitHub Profile
@Eunovo
Eunovo / swagger.ts
Last active May 9, 2024 18:58
Creating Decorators to ease Swagger documentation
import Router from "koa-router";
export const DEFINITIONS: any = {};
let DEFINITION: any = {};
export function Definition() {
return function <T extends { new(...args: any[]): {} }>(constructor: T) {
DEFINITIONS[constructor] = {
name: constructor.name,
type: "object",