utoipa
utoipa copied to clipboard
Remove `nullable: true` if the field has `#[serde(skip_serializing_if = "Option::is_none")]`
If a field, say my_field: Option<String>
is annotated with #[serde(skip_serializing_if = "Option::is_none")]
it will serialize to a string, or be removed if it is none. However the generated openapi file still has the field as nullable: true
.
Is it possible to remove the nullable on these fields?
Should be doable, for now it should be possible to enforce field to non-nullable with #[schema(nullable = false)]
.