Skip to content

Commit 5012209

Browse files
Reading from JSON Array data now works differently
1 parent 9f0c402 commit 5012209

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

src/main/java/io/frictionlessdata/tableschema/field/Field.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,19 @@ public static Field<?> forType(String type) {
530530
* @return String-serialized JSON Object containing the properties of this field
531531
*/
532532
@JsonIgnore
533+
@Deprecated
533534
public String getJson(){
534-
return JsonUtil.getInstance().serialize(this);
535+
return asJson();
535536
}
536537

538+
/**
539+
* Get the JSON representation of the Field.
540+
* @return String-serialized JSON Object containing the properties of this field
541+
*/
542+
@JsonIgnore
543+
public String asJson(){
544+
return JsonUtil.getInstance().serialize(this);
545+
}
537546

538547
@JsonIgnore
539548
public String getCastMethodName() {

src/main/java/io/frictionlessdata/tableschema/fk/ForeignKey.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,23 @@ public final void validate(Table table) throws ForeignKeyException{
149149
}
150150

151151
}
152-
152+
153+
/**
154+
* Get the JSON representation of the ForeignKey.
155+
* @return String-serialized JSON Object containing the properties of this foreign key
156+
*/
153157
@JsonIgnore
158+
@Deprecated
154159
public String getJson(){
160+
return asJson();
161+
}
162+
163+
/**
164+
* Get the JSON representation of the ForeignKey.
165+
* @return String-serialized JSON Object containing the properties of this foreign key
166+
*/
167+
@JsonIgnore
168+
public String asJson(){
155169
return JsonUtil.getInstance().serialize(this);
156170
}
157171

src/main/java/io/frictionlessdata/tableschema/fk/Reference.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,23 @@ public final void validate() throws ForeignKeyException{
107107
}
108108
}
109109
}
110-
110+
111+
/**
112+
* Get the JSON representation of the Reference.
113+
* @return String-serialized JSON Object containing the properties of this foreign key reference
114+
*/
111115
@JsonIgnore
116+
@Deprecated
112117
public String getJson(){
118+
return asJson();
119+
}
120+
121+
/**
122+
* Get the JSON representation of the Reference.
123+
* @return String-serialized JSON Object containing the properties of this foreign key reference
124+
*/
125+
@JsonIgnore
126+
public String asJson(){
113127
return JsonUtil.getInstance().serialize(this);
114128
}
115129

0 commit comments

Comments
 (0)