-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
Describe the issue
When a derived class hides an inherited member of its base, "An item with the same key has already been added" is encountered.
To Reproduce
Steps to reproduce the behavior:
- Clone https://github.com/techfg/azure-functions-openapi-extension
- Checkout brach
hide-inherited-repro
- Run sample project
Microsoft.Azure.WebJobs.Extensions.OpenApi.FunctionApp.InProc
- Open
http://localhost:7071/api/swagger/ui
in browser
Expected behavior
Swagger should display with MyDerivedClass.Data
of type MyData
property visible on MyDerivedClass
Environment (please complete the following information, if applicable):
- OS: Windows
- Browser: Edge
- Version: 1.5.1
Additional context
The problem occurs in ObjectTypeVisitor where it detects Data
property on both derived and base class. Using JsonIgnore
on base class resolves issue but that creates issues when using MyBase directly in other areas. Common use case for this scenario is deriving a base class into a generic replacing the Data
property.
Metadata
Metadata
Assignees
Labels
No labels