Skip to content

Commit ed11c3f

Browse files
committed
passed metadata schema
1 parent ed6832c commit ed11c3f

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

lib/src/main/java/com/quiltdata/quiltcore/Entry.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ public Entry(PhysicalKey physicalKey, long size, Hash hash, ObjectNode metadata)
108108
this.metadata = metadata == null ? JsonNodeFactory.instance.objectNode() : metadata.deepCopy();
109109
}
110110

111+
/**
112+
* String representation
113+
*
114+
* @return the Entry details
115+
*/
116+
@Override
117+
public String toString() {
118+
return "Entry{" +
119+
"physicalKey=" + physicalKey +
120+
", size=" + size +
121+
", hash=" + hash +
122+
", meta=" + metadata +
123+
'}';
124+
}
125+
111126
/**
112127
* Returns the physical key of the entry.
113128
*

lib/src/main/java/com/quiltdata/quiltcore/workflows/WorkflowConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private Validator makeValidatorFromSchema(String schemaId) throws ConfigurationE
254254
JsonSchemaOptions options = new JsonSchemaOptions()
255255
.setBaseUri("https://quiltdata.com/") // TODO: remove it; not actually used.
256256
.setDraft(draft);
257-
logger.info("Creating validator for schema {} with options {}", schema, options);
257+
logger.info("Creating validator for schema: {}", schema);
258258
Validator validator = Validator.create(schema, options);
259259

260260
info = new SchemaInfo(validator, schemaEffectivePhysicalKey);

lib/src/main/java/com/quiltdata/quiltcore/workflows/WorkflowValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private void validateEntries(ObjectMapper mapper, Map<String, Entry> entries) th
157157

158158
OutputUnit output = entriesValidator.validate(entriesForValidation);
159159
if (!output.getValid()) {
160-
logger.error("validateEntries: {} for validator: {}", entriesForValidation, entriesValidator);
160+
logger.error("failed: {} validateEntries: {} for validator: {}", output, entriesForValidation, entriesValidator);
161161
throw new WorkflowException("Package entries failed validation");
162162
}
163163
}
@@ -176,11 +176,11 @@ private void validateMetadata(ObjectMapper mapper, ObjectNode metadata) throws W
176176

177177
JsonNode userMeta = metadata.get("user_meta");
178178

179-
logger.debug("validateMetadata: userMeta={}", userMeta);
179+
logger.info("validateMetadata: userMeta={}", userMeta);
180180
try {
181181
OutputUnit output = metadataValidator.validate(mapper.treeToValue(userMeta, Object.class));
182182
if (!output.getValid()) {
183-
logger.error("validateMetadata: {} for validator: {}", userMeta, metadataValidator);
183+
logger.error("failed: {} validateMetadata: {} for validator: {}", output, userMeta, metadataValidator);
184184
throw new WorkflowException("Metadata failed validation");
185185
}
186186
} catch (JsonProcessingException e) {

0 commit comments

Comments
 (0)