Skip to content

Commit

Permalink
Merge pull request #9923 from bencomp/9314-get-json-object
Browse files Browse the repository at this point in the history
9314 Get JSON object from JsonUtil
  • Loading branch information
kcondon authored Sep 22, 2023
2 parents 5c6e338 + 2ae1a9f commit 5fc7b30
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import edu.harvard.iq.dataverse.workflow.step.WorkflowStepData;
import org.apache.commons.validator.routines.DomainValidator;

import java.io.StringReader;
import java.sql.Timestamp;
import java.text.ParseException;
import java.util.ArrayList;
Expand All @@ -53,7 +52,6 @@
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonObject;
import jakarta.json.JsonReader;
import jakarta.json.JsonString;
import jakarta.json.JsonValue;
import jakarta.json.JsonValue.ValueType;
Expand Down Expand Up @@ -682,8 +680,7 @@ private DatasetField remapGeographicCoverage(CompoundVocabularyException ex) thr
// convert DTO to datasetField so we can back valid values.
Gson gson = new Gson();
String jsonString = gson.toJson(geoCoverageDTO);
JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
JsonObject obj = jsonReader.readObject();
JsonObject obj = JsonUtil.getJsonObject(jsonString);
DatasetField geoCoverageField = parseField(obj);

// add back valid values
Expand Down

0 comments on commit 5fc7b30

Please sign in to comment.