-
Notifications
You must be signed in to change notification settings - Fork 46
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
Swagger - MapVogenTypes not working with class libraries #691
Comments
Thank you for the bug report @mkalinski93 . Apologies for that. I'll take a look shortly! |
Unfortunately, source generators are per-project, so it can't inspect any types found in other projects. To make this easier, I've made it generate the default namespace of the project. If you have types that need mapping and they're in different projects, then you'll need to change the registration: //opt.MapVogenTypes(); old way -for unambiguous extension method
// when you have multiple projects with types that need mapping:
WebApplication.VogenSwashbuckleExtensions.MapVogenTypes(opt);
WebApplication.Shared.VogenSwashbuckleExtensions.MapVogenTypes(opt); I've update the examples to show this too. In your library with value objects, add package [assembly: VogenDefaults(
openApiSchemaCustomizations: OpenApiSchemaCustomizations.GenerateSwashbuckleSchemaFilter | OpenApiSchemaCustomizations.GenerateSwashbuckleMappingExtensionMethod,
staticAbstractsGeneration: StaticAbstractsGeneration.MostCommon | StaticAbstractsGeneration.InstanceMethodsAndProperties] This is currently in a branch and I'll release as part of the next beta soon. Thanks again for the report |
In 5.0.5-beta3 |
Describe the bug
I have a multi repo project that I´m working on and I was using the MapVogenTypes extension method for SwaggerGen. It seems to me, that it can only find ValueObjects in the same Assembly.
Steps to reproduce
This case works. Here comes the issue
MapVogenTypes will not resolve the ValueObject that remains in the Class library.
Expected behaviour
Types should have been mapped
The text was updated successfully, but these errors were encountered: