make structs cloneable

This commit is contained in:
Joshua M. Clulow 2021-09-15 06:40:32 +00:00
parent 9c99612b9a
commit 2e5e7a1743
1 changed files with 2 additions and 2 deletions

View File

@ -943,7 +943,7 @@ fn gen(api: &OpenAPI, ts: &mut TypeSpace) -> Result<String> {
for te in ts.id_to_entry.values() {
match &te.details {
TypeDetails::Object(omap) => {
a(" #[derive(Serialize, Deserialize, Debug)]");
a(" #[derive(Serialize, Deserialize, Debug, Clone)]");
a(&format!(
" pub struct {} {{",
te.name.as_deref().unwrap()
@ -960,7 +960,7 @@ fn gen(api: &OpenAPI, ts: &mut TypeSpace) -> Result<String> {
}
TypeDetails::NewType(tid) => {
let n = te.name.as_deref().unwrap();
a(" #[derive(Serialize, Deserialize, Debug)]");
a(" #[derive(Serialize, Deserialize, Debug, Clone)]");
a(&format!(
" pub struct {}({});",
n,