Skip to content

Instantly share code, notes, and snippets.

View rashgaroth's full-sized avatar
🙀
let me cry let me cry

Rashgaroth rashgaroth

🙀
let me cry let me cry
View GitHub Profile
@Eunovo
Eunovo / swagger.ts
Last active January 14, 2025 09:22
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",