Skip to content

Commit

Permalink
MOSIP-36023
Browse files Browse the repository at this point in the history
Signed-off-by: Jayesh Kharode <[email protected]>
  • Loading branch information
Jayesh Kharode committed Sep 25, 2024
1 parent a0fba0b commit 7c550ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion uitest-resident/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-bom</artifactId>
<version>1.2.1-java21-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
Expand Down Expand Up @@ -121,11 +122,18 @@ public static void genrateCredentialRequest(String rid,String role) {

}
public static String buildaddIdentityRequestBody(String schemaJson, String uin, String rid) {
org.json.JSONObject schemaresponseJson = new org.json.JSONObject(schemaJson);
JSONObject schemaresponseJson = new JSONObject(schemaJson);

org.json.JSONObject schemaData = (org.json.JSONObject) schemaresponseJson.get("response");
Double schemaVersion = (Double) schemaData.get("idVersion");
String schemaJsonData = schemaData.getString("schemaJson");
JSONObject schemaData = (JSONObject) schemaresponseJson.get("response");
Double schemaVersion = null;
Object idVersion = schemaData.get("idVersion");
if (idVersion instanceof BigDecimal) {
schemaVersion = ((BigDecimal) idVersion).doubleValue();
} else if (idVersion instanceof Double) {
schemaVersion = (Double) idVersion;
} else {
throw new ClassCastException("Unsupported type for idVersion: " + idVersion.getClass().getName());
} String schemaJsonData = schemaData.getString("schemaJson");
String schemaFile = schemaJsonData.toString();

JSONObject schemaFileJson = new JSONObject(schemaFile); // jObj
Expand Down

0 comments on commit 7c550ac

Please sign in to comment.