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

Definitions are created when they are not referenced by any Operation #1423

Closed
AmirSasson opened this issue Dec 12, 2021 · 1 comment
Closed

Comments

@AmirSasson
Copy link

AmirSasson commented Dec 12, 2021

When using Aspnet core ApiVersion, some of my Controllers are Excluded when generating a Swagger Document on a specific version., simply by using DocInclusionPredicate.
unfortunately Swashbuckle still generates all the excluded Controllers Schemas.
the expected result is not even bother to create them.
currently, i has to implement a "Tree Shake" of definitions (document filter) that removes unreferenced definitions, But the expected result is to exlude these schamas on earlier phases as they are no references by any rendered operation.

more over sometimes, the controller with [ApiVersion] X, has conflict in schemas on controller with [ApiVersion] Y. for example Request Body class is the same name with different Namespace. which make things more complicated.
by excluding these schemas that are not use on earlier phase, it would fix the entire problem

@AmirSasson
Copy link
Author

wrong repo

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

No branches or pull requests

1 participant