Skip to content

Commit 8fcb6cb

Browse files
committed
Add import field to JsonLdHeader initialization
The JsonLdHeader struct is now initialized with an empty import vector in both the Rust template and the expected test output. This change ensures consistency with the updated struct definition and prepares for future use of the import field.
1 parent 7d9359c commit 8fcb6cb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

templates/rust.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,15 @@ pub fn default_{{ object.name | lower }}_jsonld_header() -> Option<JsonLdHeader>
164164
{%- endfor %}
165165

166166
Some(JsonLdHeader {
167+
import: Vec::new(),
167168
context: Some(JsonLdContext::Object(context)),
168169
id: Some(format!("{{ prefix }}:{{ object.name }}/{}", uuid::Uuid::new_v4())),
169170
type_: Some(TypeOrVec::Multi(vec![
170171
"{{ prefix }}:{{ object.name }}".to_string(),
171172
{%- if object.term %}
172173
"{{ object.term }}".to_string(),
173174
{%- endif %}
174-
]))
175+
])),
175176
})
176177
}
177178
{% endmacro %}

tests/data/expected_rust_ld.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ pub fn default_test_jsonld_header() -> Option<JsonLdHeader> {
146146
}));
147147

148148
Some(JsonLdHeader {
149+
import: Vec::new(),
149150
context: Some(JsonLdContext::Object(context)),
150151
id: Some(format!("tst:Test/{}", uuid::Uuid::new_v4())),
151152
type_: Some(TypeOrVec::Multi(vec![
152153
"tst:Test".to_string(),
153-
]))
154+
])),
154155
})
155156
}
156157

@@ -179,11 +180,12 @@ pub fn default_test2_jsonld_header() -> Option<JsonLdHeader> {
179180
context.terms.insert("number".to_string(), TermDef::Simple("schema:one".to_string()));
180181

181182
Some(JsonLdHeader {
183+
import: Vec::new(),
182184
context: Some(JsonLdContext::Object(context)),
183185
id: Some(format!("tst:Test2/{}", uuid::Uuid::new_v4())),
184186
type_: Some(TypeOrVec::Multi(vec![
185187
"tst:Test2".to_string(),
186-
]))
188+
])),
187189
})
188190
}
189191

0 commit comments

Comments
 (0)