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

ObjectTypeVisitor - cast to OpenApiSchemaAcceptor instead of IOpenApiSchemaAcceptor #654

Open
Wozbo opened this issue May 10, 2024 · 1 comment

Comments

@Wozbo
Copy link

Wozbo commented May 10, 2024

Describe the issue
azure-functions-openapi-extension/src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors
/ObjectTypeVisitor.cs

Line ~110 ish, there is a line that reads var instance = acceptor as OpenApiSchemaAcceptor;. When testing with a custom
IOpenApiSchemaAcceptor, this was not processing, its because we cast to the concrete implementation type instead of the interface type. This stumped us recently, debugging attribute errors with duplicate keys.

Expected behavior
I think this should be var instance = acceptor as IOpenApiSchemaAcceptor

Screenshots
If applicable, add screenshots to help explain your issue.
image

@Wozbo
Copy link
Author

Wozbo commented May 10, 2024

Adding to this, seems like this is also an issue in TypeVisitor.cs, line ~126 ish

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