Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethhealy committed Nov 20, 2024
1 parent a32a60e commit 9b3ca82
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sdk/src/main/java/io/opentdf/platform/sdk/Manifest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import org.apache.commons.codec.binary.Hex;
import org.erdtman.jcs.JsonCanonicalizer;
// import org.slf4j.Logger;
// import org.slf4j.LoggerFactory;
// import org.slf4j.Logger;
// import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.Reader;
Expand Down Expand Up @@ -533,16 +533,20 @@ private JWSVerifier createVerifier(AssertionConfig.AssertionKey assertionKey) th
// }
// }

public static class ManifestDeserializer implements JsonDeserializer<Manifest> {
public static class ManifestDeserializer implements JsonDeserializer<Object> {
public static Logger logger = LoggerFactory.getLogger(ManifestDeserializer.class);
@Override
public Manifest deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
logger.info("deserializing manifest");
// Let Gson handle the default deserialization of the object first
Manifest manifest = new Gson().fromJson(json, typeOfT);

logger.info("after gson");
// Now check if the `assertions` field is null and replace it with an empty list if necessary
if (manifest.assertions == null) {
logger.info("found null");
manifest.assertions = new ArrayList<>(); // Replace null with empty list
}
logger.info(manifest.assertions.toString());

return manifest;
}
Expand Down

0 comments on commit 9b3ca82

Please sign in to comment.