diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-01-17 01:13:45 +0100 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-01-17 01:13:45 +0100 |
commit | 92c913c457d41b4246e1d382b28fcc24510f0034 (patch) | |
tree | a7b324013c025959e6f26e5d19d11fa941e7b729 /generator/src/main.rs | |
parent | put structs in a module (diff) | |
download | forgejo-api-92c913c457d41b4246e1d382b28fcc24510f0034.tar.xz forgejo-api-92c913c457d41b4246e1d382b28fcc24510f0034.zip |
make generated fields public
Diffstat (limited to '')
-rw-r--r-- | generator/src/main.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/generator/src/main.rs b/generator/src/main.rs index 6ca30d0..193d437 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -730,6 +730,7 @@ fn create_struct_for_definition( fields.push_str(prop_name); fields.push_str("\")]\n"); } + fields.push_str("pub "); fields.push_str(&field_name); fields.push_str(": "); fields.push_str(&field_ty); @@ -805,6 +806,7 @@ fn create_query_struct(spec: &OpenApiV2, path: &str, op: &Operation) -> eyre::Re let ty = param_type(param, true)?; let field_name = sanitize_ident(¶m.name); let required = param.required.unwrap_or_default(); + fields.push_str("pub "); fields.push_str(&field_name); fields.push_str(": "); if required { |