-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Bug]: A nullable struct property results in an invalid generated schema. #3013
Comments
We are having the same issue. |
Add example controller code from domaindrivendev#3013.
Looks like this was broken by #2941. |
Fix incorrect handling of schemas for nullable properties. Resolves domaindrivendev#3013.
Sorry for the inconvenience! |
This is doubly bad because object types as references that are properties of an object or request are not allowed to have descriptions. This makes 6.7.0 unusable for us as it results in most of our API docs being unusable with unhelpful descriptions of object properties/request parameters being the description of the schema itself (empty in the case of these "NullableInt32" etc. types). |
Add example controller code from #3013.
Version 6.7.1 is now available from NuGet.org which resolves this issue. |
Describe the bug
Invalid schema has been generated in cases where a type has a nullable property of a custom struct.
Version 6.2.2 behaves in the expected way.
Expected behavior
A valid schema should be generated.
Actual behavior
An invalid (and recursive) schema has been generated.
Steps to reproduce
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
6.7.0
.NET Version
net8.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: