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

[3.x]: Hide the default section per area with new config parameter #1868

Merged
merged 7 commits into from Oct 6, 2021

Conversation

Havrin
Copy link
Contributor

@Havrin Havrin commented Aug 31, 2021

By adding a new config parameter it is possible to hide the "default" section in your config.

Approach is to not register the RouteDescriber as a tagged service per area.

Fixes: #1458

Frederik Holz added 2 commits August 31, 2021 16:14
…teDescriber to specific areas which allowes disabling rendering of default routes, Adjust tests accordingly
@GuilhemN
Copy link
Collaborator

GuilhemN commented Sep 3, 2021

Thanks a lot for your proposal!

However, I'm not sure this is the correct approach, this means we would no longer leverage php annotations, symfony routes, etc. when using this option and that would be quite confusing (as well as suboptimal) in my opinion.

What do you think about the alternative I suggested in #1458 (comment), about filtering the routes passed to the RouteDescriber depending on the presence of some OA annotations?

@Havrin
Copy link
Contributor Author

Havrin commented Sep 6, 2021

@GuilhemN my idea was to prevent generating those routes so it will be faster. But you are right, there can be side effects.
I will check your comment and change the MR accordingly :)

@Havrin
Copy link
Contributor Author

Havrin commented Oct 4, 2021

@GuilhemN in case the notification slipped through: I changed it like discussed in the Bugticket :) let me know if somethings wrong.

@GuilhemN GuilhemN merged commit aa18c6c into nelmio:3.x Oct 6, 2021
@GuilhemN
Copy link
Collaborator

GuilhemN commented Oct 6, 2021

That's great, thank you @Havrin!

@Havrin Havrin deleted the feature/disable-default-routes branch October 6, 2021 20:44
@roger-codina
Copy link

roger-codina commented Nov 26, 2021

Hi guys, why this feature is not present in the 4.x versions?

https://github.com/nelmio/NelmioApiDocBundle/blob/v4.6.2/DependencyInjection/Configuration.php#L52

Even the FAQs about 4.x:
https://symfony.com/bundles/NelmioApiDocBundle/4.x/faq.html#disable-default-section
are refering to this feature that was added with this current PR.

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants