Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
elbassel opened this issue May 29, 2024 · 1 comment

Comments

@elbassel
Copy link

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.

@PodaruDragos
Copy link
Contributor

PodaruDragos commented May 29, 2024

this would be a great idea, PR's are welcomed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants