-
Notifications
You must be signed in to change notification settings - Fork 57
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
String field cannot be optional. #122
Comments
This is by design. So, technically speaking, the
as |
There are several facts.
It can be understood that null can not be removed. (by 1.) Similar situations. SQL Server has intended to be null (NULL Column) https://github.com/fsprojects/FSharp.Data.SqlClient this library type following. I think so. Honestly, there is a problem of preference. |
I came here to post about the same thing, it'd be really helpful to have this as an option like we do with IgnoreOperationId, at least in my case. I have a RESTful API serving data from SQL where some columns are nullable text while others are not. A lot of these endpoints serve basic CRUD operations, and so I made a generic editor that uses reflection on the client generated by SwaggerProvider to save myself time from coding each one by hand. Unfortunately I don't really see a good way to determine which strings are actually nullable and which are not, so I can't easily communicate that through the generic editors (and pretty much every one has a mixture of non-nullable and nullable strings) While .NET does have nullable strings, if the spec is communicating that they're non-nullable, I think it makes sense to try and conform to the spec as close as possible with an option type. |
Description
Primitive Types can be optional.
but string field can not be optional.
Repro steps
provide following this in swagger yaml
read property by SwaggerProvider
Expected behavior
nullable string field should be Option type.
Actual behavior
nullable string field is not Option type.
Known workarounds
Related information
Windows 10
0.10.0-beta05
The text was updated successfully, but these errors were encountered: