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
The logic to prevent a field from becoming required when skip_serializing_if is present works as intended, however, it appears that the property type still includes both the type itself as well as 'null'.
It would be nice if only the primary type was included in the spec upon successful detection of an Option implying that a field is not required and null will not be serialized.
The text was updated successfully, but these errors were encountered:
So if type is Option<i32> then what should happen? Should there be a way to not to include type to the OpenAPI spec when type is a optional primitive type? I don't quite grasp what should be done here. But sounds like some feature enhancement.
Expected:
Given skip_serializing_if is present on the field
And the field is an option
Then the openapi spec field type has just the primitive type
And the openapi spec does not mark the field as required
Current:
Given skip_serializing_if is present on the field
And the field is an option
Then the openapi spec field type has both the primitive type and 'null'
And the openapi spec does not mark the field as required
In my opinion, the logic that was introduced to respect skip_serializing_if is incomplete, in that it successfully marks the field as not required, but it also indicates that the field could be present and 'null', even though skip_serializing_if prevents the field from ever being present and null.
The logic to prevent a field from becoming required when skip_serializing_if is present works as intended, however, it appears that the property type still includes both the type itself as well as 'null'.
It would be nice if only the primary type was included in the spec upon successful detection of an Option implying that a field is not required and null will not be serialized.
The text was updated successfully, but these errors were encountered: