Skip to content

Support for Open API documentation auto generation in express utils and other frameworks #426

Open
@elbassel

Description

@elbassel

Expected Behavior

Imagine having an API that handles creating game data and returns the created user information. For example:

@HttpPost("/",`` { description: "create a game" })
async createGame(@requestBody() gameData: CreateGameData, @request() req: Request): Promise {
const newGame = await this.gameService.createGame(gameData, deps);
newGame.status = GameStatusLabelBuilder.build(newGame, req.language);
return newGame;
}

In this scenario, API documentation could be auto-generated based on the HTTP method annotations, function arguments, and return types. This would ensure the documentation is always up-to-date and more reliable compared to manual documentation.

Current Behavior

Currently, this feature does not seem to be implemented.

Possible Solution

Implement a mechanism to generate the Swagger YAML file at runtime based on the HTTP method annotations, function arguments, and return types.

Context

Auto-generating API documentation will keep it consistently up-to-date and more accurate, significantly improving over the manual documentation process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions