diff --git a/src/build/manifest.hbs b/src/build/manifest.hbs index 8275dacb3..f0662a984 100644 --- a/src/build/manifest.hbs +++ b/src/build/manifest.hbs @@ -26,6 +26,7 @@ serde_json = "1.0" serde_yaml = "0.8" tokio-util = \{ version = "0.4", features = ["codec"] } url = "2.1" +utoipa = \{ version = "2.2", features = ["actix_extras", "yaml", "json", "chrono", "uuid", "debug", "openapi_extensions"] } uuid = \{ version = "^1.0", features = ["serde"] } {{ if is_cli }} anyhow = "1.0" diff --git a/src/v2/codegen/object.rs b/src/v2/codegen/object.rs index 3af6ae04e..dcc213574 100644 --- a/src/v2/codegen/object.rs +++ b/src/v2/codegen/object.rs @@ -900,7 +900,7 @@ impl Display for ApiObject { return self.write_enum(f); } - f.write_str("#[derive(Debug, Default, Clone, Serialize, Deserialize)]\npub struct ")?; + f.write_str("#[derive(Debug, Default, Clone, Serialize, Deserialize, utoipa::ToSchema)]\npub struct ")?; f.write_str(&self.name)?; if !self.inner.is_enum() && self.fields().iter().any(|f| f.needs_any) { ApiObject::write_any_generic(f)?;