Skip to content

Commit 1dc7626

Browse files
committed
feat(rengine): derive schemars::JsonSchema for AST
1 parent 06a3cad commit 1dc7626

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

rust-printer/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ readme.workspace = true
1212
hax-frontend-exporter = { path = "../frontend/exporter", default-features = false }
1313
serde = { workspace = true, features = ["derive"] }
1414
hax-rust-engine-macros = { path = "macros" }
15+
schemars.workspace = true

rust-printer/macros/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ pub fn derive_group_for_ast(_attr: TokenStream, item: TokenStream) -> TokenStrea
5252
/// Derive the necessary [de]serialization related traits for nodes in the AST.
5353
#[proc_macro_attribute]
5454
pub fn derive_group_for_ast_serialization(_attr: TokenStream, item: TokenStream) -> TokenStream {
55-
add_derive(item, quote! {::serde::Deserialize, ::serde::Serialize})
55+
add_derive(
56+
item,
57+
quote! {::serde::Deserialize, ::serde::Serialize, ::schemars::JsonSchema},
58+
)
5659
}
5760

5861
/// Derive the basic necessary traits for nodes in the AST.

0 commit comments

Comments
 (0)