Safer version of SchemaSerialiser that forces specifying a class.