summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerris Tseng <ferris@navapbc.com>2020-03-22 18:15:14 -0400
committerFerris Tseng <ferris@navapbc.com>2020-03-22 18:15:14 -0400
commit4fdf4a765e4f7ef9f6ad22c76c3e10f875613b16 (patch)
tree263c36952577e4ec884c7c0a061cedca06b9196b
parent7fd5b7e7ca7174b4926fadb31decbec5e38a5cf0 (diff)
make version and system fields optional
-rw-r--r--ipfs-api/src/response/tests/v0_version_1.json5
-rw-r--r--ipfs-api/src/response/version.rs9
2 files changed, 12 insertions, 2 deletions
diff --git a/ipfs-api/src/response/tests/v0_version_1.json b/ipfs-api/src/response/tests/v0_version_1.json
new file mode 100644
index 0000000..2d3b706
--- /dev/null
+++ b/ipfs-api/src/response/tests/v0_version_1.json
@@ -0,0 +1,5 @@
+{
+ "Version": "0.4.11",
+ "Commit": "",
+ "Repo": "6"
+}
diff --git a/ipfs-api/src/response/version.rs b/ipfs-api/src/response/version.rs
index 57c6857..ec6837b 100644
--- a/ipfs-api/src/response/version.rs
+++ b/ipfs-api/src/response/version.rs
@@ -14,11 +14,16 @@ pub struct VersionResponse {
pub version: String,
pub commit: String,
pub repo: String,
- pub system: String,
- pub golang: String,
+
+ // Not declared in the IPFS interface spec.
+ pub system: Option<String>,
+
+ // Only for the Go implementation of IPFS.
+ pub golang: Option<String>,
}
#[cfg(test)]
mod tests {
deserialize_test!(v0_version_0, VersionResponse);
+ deserialize_test!(v0_version_1, VersionResponse);
}