-
Notifications
You must be signed in to change notification settings - Fork 783
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
Seq.empty renders as "EmptyEnumerable"
#17864
Comments
I realize this is horrendously incomplete, but I didn't find the condition to be easy to search for, and saying nothing is not ideal either. If it was me fixing as a quick win without root causing / understanding the required interfaces/moving parts more deeply, I'd make Here's hoping I eventually get to the point of circling back with a trimmed down repro that identifies whether this is a JSON.NET problem, a JsonConverter+JSON.NET problem, or only solvable by implementing a relevant interface on |
Interesting:
|
Yeah, it'd definitely be a more widespread problem if it was something fundamental. |
I don't think it is in aspnetcore.
But tbh I find |
I'm not ruling anything in or out
(But I have yet to test how that renders either - All I know for a fact is that |
F# type checking infers |
Yeah, it's not entirely/only about the static type from the perspective of the compiler though - ultimately |
Seq.empty<MyType>
renders as the string"EmptyEnumerable"
when fed through AspNetCore 8ObjectResult
The same does not happen for
Seq.choose
and other such functions when they yield an empty sequence, as they yield a different internal impl type wrapping their output, which in my context winds up producing[]
as requiredExpected behavior
render as
[]
Actual behavior
renders as
"EmptyEnumerable"
Known workarounds
use
Array.empty<MyType>
insteadRelated information
MyType
has a JsonConverter registeredSystem.Linq.Enumerable.Empty<MyType>()
The text was updated successfully, but these errors were encountered: