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'm running into issues where utoipa with the repr feature enabled is generating an openapi definition that is not compatible with the serde annotations I'm using. Because I'm using sqlx's Type trait I've added an #[repr(i8)] declaration, but I don't want to expose this enum directly to my API, so I derive Serialize/Deserialize for it. I did want to expose a few other enums, so these do use Serialize_repr/Deserialize_repr.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I'm running into issues where utoipa with the repr feature enabled is generating an openapi definition that is not compatible with the serde annotations I'm using. Because I'm using sqlx's Type trait I've added an #[repr(i8)] declaration, but I don't want to expose this enum directly to my API, so I derive Serialize/Deserialize for it. I did want to expose a few other enums, so these do use Serialize_repr/Deserialize_repr.
This generates a schema that suggests ints need to be used but the actual deserialization code expects strings.
Is it possible to disable Utoipa's repr detection on certain structs without disabling it on all structs?
Beta Was this translation helpful? Give feedback.
All reactions