Skip to content

Adding Typescript Schema types into the comments #246

@RadientBrain

Description

@RadientBrain

How to add a predefined type objects already defined in a Typescript file to render it for the POST body request via the comments? Similar feature is present in "gin-swagger" but that is for golang, I thought that kind of feature should also be added here.
Any ideas on it? @kevinccbsg @wbw20 @ciprian1234 @meabed

Like below is the comment I want to write which should generate the type defined (here Activity is a Schema type object):

/**
* POST /activity/add
* @param {Activity} request.body.required - Activity type
**/

or just an additional line like this in the existing defined comments:
@schema Activity activity_description

The Activity type is defined as follows:

export type Activity = {
    wakeup: string;
    goto: string;
    runfor: number;
}

So, at last it should generate the whole Activity Schema without me defining each and every detail of the type again into the comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions