Closed LucaCris closed 1 week ago
Please provide a minimal reproducible example as a GitHub repository that demonstrates the issue you're experiencing so we can look into this further.
I have the same issue/exception. But I think I found how to workaround it - I have a property defined like:
[DataMember]
[Required]
[DefaultValue(1)]
public double Factor { get; set; } = 1;
and I have that exception in 6.6.1 (not in 6.5.0).
But if I remove DefaultValue attribute or set it as [DefaultValue(1D)]
(explicit double instead of int) it is working fine.
Interesting - what version of .NET are you using?
I wonder if this is something to do with changes in .NET 8 that Swashbuckle is now consuming because we have a net8.0
target now.
.NET 8.0.5
Is it possible you could provide a stack trace that includes our line numbers when the exception happens?
I think the changes for #2800 is what's making this issue appear, I'm just having trouble reconciling exactly which code path it's going down when it hits that.
I'll try debugging things with the sample you've given me anyway as that will probably point to what's going wrong.
I've gotten a repro for this based on https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2885#issuecomment-2112370550 now, thanks.
I also have the same scheme:
[XmlAttribute]
[DefaultValue(0)]
public double ParamVal1 { get; set; }
Not yet tested the workaround above.
Cost me hours. Happy for the fix
Thanks for reporting this issue - the fix is available in Swashbuckle.AspNetCore 6.6.2.
Thanks for reporting this issue - the fix is available in Swashbuckle.AspNetCore 6.6.2.
Just tried, it works! Thanks...
Describe the bug
Rollbacked to 6.5.0 due to non-sense exception:
Expected behavior
As in 6.5.0 the standard swagger page.
Actual behavior
No response
Steps to reproduce
No response
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
6.6.1
.NET Version
net 8.0.5
Anything else?
No response