Skip to content

Commit

Permalink
Add utoipa hack
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Nov 2, 2022
1 parent 02b6cca commit f8ba534
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/build/manifest.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/v2/codegen/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit f8ba534

Please sign in to comment.