Skip to content

Instantly share code, notes, and snippets.

@alexanderdean
Last active August 29, 2015 14:10
Show Gist options
  • Save alexanderdean/1c2dfad1328093b08855 to your computer and use it in GitHub Desktop.
Save alexanderdean/1c2dfad1328093b08855 to your computer and use it in GitHub Desktop.
Sample
// Request body expected to validate against this JSON Schema
private val PayloadDataSchema =
SchemaCriterion("com.snowplowanalytics.snowplow", "payload_data", "jsonschema", 1, 0)
// Check JSON is a payload_data version 1-0-*, and verify it against the schema
val body: ValidatedNel[JsonNode] = bodyNode.verifySchemaAndValidate(schemaCriterion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment