You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I debugged into the Swashbuckle code to see what's going on, and it seems that for form parameters there is no associated DataProperty, essentially leading to not rendering some metadata properties at all:
isRequired
isNullable
isReadOnly
isWriteOnly
Can't tell if isReadOnly or isWriteOnly would make sense for form parameters, but isRequired and isNullable definitely do. Our use case is a generated C# client (via NSwag), that therefore has a mismatching nullability.
Our workaround currently is an additional IRequestBodyFilter, that sets the nullability of the affected properties manually.
The text was updated successfully, but these errors were encountered:
To make issue tracking a bit less overwhelming for the new maintainers (see #2778), I've created a new tracking issue to roll-up various nullability issues here: #2793.
We'll refer back to this issue from there and include it as part of resolving that issue, but I'm going to close this one to help prune the backlog.
Observed in: Swashbuckle.AspNetCore 6.4.0
Nullability of (primitive) form parameters is not respected (i.e. misses
nullable: true
) in the generated schema.Can reproduce that by using a Controller in ASP.NET Core (6 or 7, doesn't matter), saying
resulting in
I debugged into the Swashbuckle code to see what's going on, and it seems that for form parameters there is no associated
DataProperty
, essentially leading to not rendering some metadata properties at all:Can't tell if
isReadOnly
orisWriteOnly
would make sense for form parameters, butisRequired
andisNullable
definitely do. Our use case is a generated C# client (via NSwag), that therefore has a mismatching nullability.Our workaround currently is an additional
IRequestBodyFilter
, that sets the nullability of the affected properties manually.The text was updated successfully, but these errors were encountered: