ToSchema

trait ToSchema[E]

A mixin for ExtractSchemaMap, signalling that this particular instance of ExtractSchemaMap is intended for extracting schema, not data.

An example input is:

  {
    "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
    "description": "Schema for a user entity",
    "self": {
       "vendor": "com.vendor",
       "name": "user_entity",
       "format": "jsonschema",
       "version": "1-0-0"
    },
    "type": "object",
    "properties": {
       "id": {
         "type": "string"
       },
       "email": {
         "type": "string"
       }
    }
  }

which contains a schema that can be extracted as a SelfDescribingSchema.

class Object
trait Matchable
class Any

Value members

Abstract methods

protected def checkSchemaUri(entity: E): Either[ParseError, Unit]

Validate the URI specified with the "$schema" keyword.

Validate the URI specified with the "$schema" keyword.

protected def getContent(entity: E): E

Concrete methods

def toSchema(schema: E): Either[ParseError, SelfDescribingSchema[E]]