Skip to content

Generating multiple swagger documents is not supported #1233

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

Closed
maurei opened this issue Dec 20, 2022 · 0 comments · Fixed by #1448
Closed

Generating multiple swagger documents is not supported #1233

maurei opened this issue Dec 20, 2022 · 0 comments · Fixed by #1448

Comments

@maurei
Copy link
Member

maurei commented Dec 20, 2022

Exposing multiple swagger documents as described here fails. The problem is that our custom ISchemaGenerator is registered as a singleton, causing the same ISchemaRepositoryAccessor to be reused for different documents.

The fix is to register our ISchemaGenerator as transient, probably.

Along the way, we should consider to not deviate from the lifetimes used in Swashbuckle for other similar services. We're going with singleton most of the time, which can lead to unexpected problems like it did here.

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

Successfully merging a pull request may close this issue.

2 participants