From 3a19f4de1058221a9740eb4dc81d924b2bb0618e Mon Sep 17 00:00:00 2001 From: Oguzhan Unlu Date: Mon, 18 Dec 2017 12:39:28 +0300 Subject: [PATCH] Schema DDL: add uuid format (close #305) --- .../iglu.schemaddl/jsonschema/StringProperties.scala | 1 + .../iglu.schemaddl/jsonschema/json4s/StringSerializers.scala | 1 + 2 files changed, 2 insertions(+) diff --git a/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/StringProperties.scala b/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/StringProperties.scala index 927ed3bf..a2318ecd 100644 --- a/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/StringProperties.scala +++ b/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/StringProperties.scala @@ -54,6 +54,7 @@ object StringProperties { case object DateTimeFormat extends Format { val asString = "date-time" } case object DateFormat extends Format { val asString = "date" } case object HostNameFormat extends Format { val asString = "hostname" } + case object UuidFormat extends Format { val asString = "uuid" } /** * Implementations MAY add custom format attributes diff --git a/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/json4s/StringSerializers.scala b/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/json4s/StringSerializers.scala index be519b0d..f0926a46 100644 --- a/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/json4s/StringSerializers.scala +++ b/0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/json4s/StringSerializers.scala @@ -30,6 +30,7 @@ object StringSerializers { case JString(format) if format == "hostname" => HostNameFormat case JString(format) if format == "date-time" => DateTimeFormat case JString(format) if format == "date" => DateFormat + case JString(format) if format == "uuid" => UuidFormat case JString(format) => CustomFormat(format) case x => throw new MappingException("Format must be string") },