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

Example: Is it possible to merge OA\Components ? #1552

Open
ahmadfadlydziljalal opened this issue Mar 4, 2024 · 1 comment
Open

Example: Is it possible to merge OA\Components ? #1552

ahmadfadlydziljalal opened this issue Mar 4, 2024 · 1 comment

Comments

@ahmadfadlydziljalal
Copy link

Basically, this is not an issue.
Just ask, is it possible to merge OA\Components ?

The case is, I have a lot of controllers.
For maintainability, at least for myself, I separate the controllers like this:

image

But, I got an error, and I know, what exactly those error.

PHP User Warning 'yii\base\ErrorException' with message 'Only one @OA\Components() allowed for @OA\OpenApi() multiple found in:
    Using: /var/www/html/modules/v1/controllers/AgamaController.php on line 226
  Skipped: /var/www/html/modules/v1/controllers/MeController.php on line 128'

in /var/www/html/vendor/zircote/swagger-php/src/Loggers/DefaultLogger.php:31


It so readable in each route/action.

image

Any suggestion is so appreciated.

@DerManoMann
Copy link
Collaborator

Hmm, I guess we could just merge components if more than one is found. Components is a container so that would make sense I suppose.

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

No branches or pull requests

2 participants