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

Create a different OpenAPI Handler for each "tag" #692

Closed
MahdiBM opened this issue Dec 8, 2024 · 1 comment
Closed

Create a different OpenAPI Handler for each "tag" #692

MahdiBM opened this issue Dec 8, 2024 · 1 comment
Labels
kind/feature New feature. status/triage Collecting information required to triage the issue.

Comments

@MahdiBM
Copy link
Contributor

MahdiBM commented Dec 8, 2024

Motivation

The generator currently only creates one big OpenAPI Handler protocol.
This makes it hard to organize the routes.

Proposed solution

Create a different OpenAPI Handler for each "tag" so we have something close to Vapor "controllers".
These are quite useful for decluttering the code.

The generator could also generate each tag's "controller protocol" in it's own file. There are known issues in the Swift compiler where it struggles to handle one big file, or makes builds potentially extremely slower.

Alternatives considered

Manually handling this by different methods, including manually creating controllers and redirecting the routes in the main openapi handler to those controllers, or using multiple targets and filtering a shared openapi file based on tag in each controller.

Additional information

No response

@MahdiBM MahdiBM added kind/feature New feature. status/triage Collecting information required to triage the issue. labels Dec 8, 2024
@czechboy0
Copy link
Contributor

Dup of #691

@czechboy0 czechboy0 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature. status/triage Collecting information required to triage the issue.
Projects
None yet
Development

No branches or pull requests

2 participants