fix: make ast node ids optional (#1254)

This commit is contained in:
Bjerg 2022-05-12 23:47:38 +02:00 committed by GitHub
parent 4ba8adf87c
commit 1e2b02920b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,8 @@ pub struct Ast {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Node {
/// The node ID.
pub id: usize,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<usize>,
/// The node type.
#[serde(rename = "nodeType")]