Execption thrown when generating OpenAPI document using F# #59536
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-openapi
Is there an existing issue for this?
Describe the bug
When using a very specific combination of types in F#, the OpenAPI document fails to generate and an exception is thrown. I believe it is a similar bug to #58213, but in this case the parent type is not referenced from a sub-type, which was the suspected cause in that case. Recreating the same code in C# failed to recreate the bug.
Specifically, all of these conditions have to be true to trigger the exception:
Dog.favoriteFoods
has to be an array, or at least not just a stringTest1Result
has to include fields of typeDog
andAnimal
Animal
andTest1Result
have to be response typesExpected Behavior
The OpenAPI document is successfully generated.
Steps To Reproduce
A minimalist project recreating the issue is here:
https://github.com/josh-coproduct/FSharp-OpenAPI-Bug-Sample
It includes the F# code the triggers the bug, and the C# code that does not.
Launching the F# project should open a browser window to http://localhost:5047/openapi/v1.json, which should trigger the bug and show the exception.
Exceptions (if any)
.NET Version
9.0.101
Anything else?
No response
The text was updated successfully, but these errors were encountered: