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

SwaggerBake.beforeRender event is not allowing modification of the Swagger::array #202

Closed
cnizzardini opened this issue Oct 6, 2020 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cnizzardini
Copy link
Owner

Describe the bug
SwaggerBake.beforeRender event is not allowing modification of the Swagger::array

To Reproduce

        EventManager::instance()
            ->on('SwaggerBake.beforeRender', function (Event $event) {
                /** @var Swagger $swagger */
                $swagger = $event->getSubject();
                $openApi = $swagger->getArray();
                $openApi['info']['description'].= ' This is sentence was added via the SwaggerBake.beforeRender event';
                $swagger->setArray($openApi);

                return $swagger;
            });

Expected behavior
Can modify array

Version and Platform (please complete the following information):

  • OS/Platform: Linux
  • CakePHP: 4.1.5
  • SwaggerBake Version: 1.5.8
@cnizzardini cnizzardini added the bug Something isn't working label Oct 6, 2020
@cnizzardini cnizzardini added this to the 1.5.9 milestone Oct 6, 2020
@cnizzardini cnizzardini self-assigned this Oct 6, 2020
cnizzardini added a commit that referenced this issue Oct 6, 2020
Moves event trigger into toString and provides setArray. Adds better
examples to readme.
cnizzardini added a commit that referenced this issue Oct 6, 2020
Fixes bug with using SwaggerBake.beforeRender #202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant