anchor.diff:      {Version, decode_record({Term}, {record, Version, Fields})}.
   
   
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Validates given record structure.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec validate_struct(record_struct()) -> ok | no_return().
   validate_struct({record, Fields}) when is_list(Fields) ->
       ok.
  
positive.code:     {record, Fields} = Type:record_struct(Version),
      encode_record(Value, {record, Version, Fields}).
  
  encode_record(Term, Struct) ->
      encode_record(value, Term, Struct).
  
  
  decode_record({Term}) when is_list(Term) ->
      Type = decode_record(proplists:get_value(<<?RECORD_TYPE_MARKER>>, Term), atom),
      Version = decode_record(proplists:get_value(<<?RECORD_VERSION_MARKER>>, Term), integer),
  
negative.code: %%% Internal functions
  %%%===================================================================
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Encodes given term to ejson with given structure. Given term can be either
  %% encoded as json key or value. This distinction is required since JSON disallows keys with types other then string.
  %% @end
  %%--------------------------------------------------------------------
  -spec encode_record(key | value, term(), record_struct()) -> ejson() | no_return().
  encode_record(value, undefined, _) ->
      null;
  encode_record(value, Term, {custom_value, {M, Encoder, _Decoder}}) ->
  