azure-functions-openapi-extension
azure-functions-openapi-extension copied to clipboard
Allow inherited lists as reference types
This addresses the issue that inherited lists (or custom implementations of IEnumerable<T>) cannot be used and will lead to runtime exceptions (e.g. #380).
Implementation Detail:
- Distinguish between framework implementations of enumerable (checking via
Namespace?.StartsWith("System")) and custom / inherited enumerable implementations - Extend the
ListObjectTypeVisitorto produce a reference if a custom list is used (as an alternative we could implement anotherVisitor) - Adding
IsReferencedOpenApiArraychecks where necessary
I added additional unit / integration tests to cover this use case.
Let me know what you think and if you favor changes / a different implementation. If accepted this approach could be applied for dictionaries also (#313), see proof of concept branch Dresel:v2-dictionary-as-reference-types.
Let me fix those tests first 😄
Can we accelerate this?