-
Notifications
You must be signed in to change notification settings - Fork 195
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
Fix: OpenAPI attributes are not getting picked up if they are in a referenced class library project #298 #301
Conversation
…ced class library project Azure#298
There are 8 references of this function and I wasn't sure which ones needed to get the referenced types as well. I just changed the one that was causing the problem for me, perhaps more changes should be made and if they are more, we could potentially change the default value to true |
@PanosKousidis Thanks for the PR! It could be really helpful. Do you mind providing a sample repo that causes the issue so that I can reproduce the same error on my end? |
Thanks for the sample repo! I was able to reproduce the error. I'll take a look + I'll take a further look, if we can also apply this approach to the in-proc worker. |
src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Extensions/AssemblyExtensions.cs
Outdated
Show resolved
Hide resolved
…ced class library project (Azure#298)
src/Microsoft.Azure.Functions.Worker.Extensions.OpenApi/Extensions/DocumentHelperExtensions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Extensions/AssemblyExtensions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/VisitorCollection.cs
Outdated
Show resolved
Hide resolved
Hi @justinyoo , I had a deeper look and it turns out that changing it to always include referenced types causes errors for 2 reasons:
To resolve (1) I changed the code in To resolve (2) I just excluded all types that belong in a namespace that starts with Now the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments. Would you please be able to take a look?
…ced class library project (Azure#298)
Yep, that's done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the long wait! It looks good to me.
This solution introduces an optional parameter to load referenced assemblies' types as well when trying to find out which methods are eligible to be shown on the SwaggerUI