Commit f0ee632f authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Ignore unknown properties when parsing JSON files.

Avoids parse issues with previously deprecated and later removed
fields like "as_number" in details documents.
parent 7121a3a8
# Changes in version 7.0-1.18.1 - 2018-09-11
* Medium changes
- Ignore unknown properties when parsing JSON files, which includes
previously deprecated and later removed fields like "as_number"
in details documents.
# Changes in version 7.0-1.18.0 - 2018-09-10
* Medium changes
......
......@@ -4,6 +4,7 @@
package org.torproject.onionoo.docs;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
......@@ -18,6 +19,9 @@ import com.fasterxml.jackson.databind.annotation.JsonNaming;
getterVisibility = JsonAutoDetect.Visibility.NONE,
isGetterVisibility = JsonAutoDetect.Visibility.NONE,
setterVisibility = JsonAutoDetect.Visibility.NONE)
/* Ignore unknown properties including previously deprecated and later removed
* fields. */
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class Document {
private transient String documentString;
......
......@@ -4,6 +4,7 @@
package org.torproject.onionoo.docs;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
......@@ -20,6 +21,9 @@ import java.util.List;
getterVisibility = JsonAutoDetect.Visibility.NONE,
isGetterVisibility = JsonAutoDetect.Visibility.NONE,
setterVisibility = JsonAutoDetect.Visibility.NONE)
/* Ignore unknown properties including previously deprecated and later removed
* fields. */
@JsonIgnoreProperties(ignoreUnknown = true)
public class GraphHistory {
private String first;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment