Skip to content

Commit b286827

Browse files
committed
add support for developers array in mod.json
1 parent 09f8ba3 commit b286827

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/types/mod_json.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub struct ModJson {
2626
pub version: String,
2727
pub id: String,
2828
pub name: String,
29-
pub developer: String,
29+
pub developer: Option<String>,
30+
pub developers: Option<Vec<String>>,
3031
pub description: Option<String>,
3132
pub repository: Option<String>,
3233
pub issues: Option<serde_json::Value>,
@@ -354,6 +355,12 @@ impl ModJson {
354355
)));
355356
}
356357

358+
if self.developer.is_none() && self.developers.is_none() {
359+
return Err(ApiError::BadRequest(
360+
"No developer specified on mod.json".to_string(),
361+
));
362+
}
363+
357364
if self.id.len() > 64 {
358365
return Err(ApiError::BadRequest(
359366
"Mod id too long (max 64 characters)".to_string(),

0 commit comments

Comments
 (0)