anchor.diff:  %% EJson-encoded Erlang data structure.
   -spec parse_binary_json( binary()) -> {ok, ejson_term() }. % or throw
   parse_binary_json(Bin) ->
  +    parse_binary_json(Bin, create).
  +
  +-spec parse_binary_json( binary(), create | update ) -> {ok, ejson_term() }. % or throw
  +parse_binary_json(Bin, Operation) ->
     User = ejson:decode(Bin),
     %% If user is invalid, an error is thown
  -  validate_user(User, user_spec()),
  +  validate_user(User, user_spec(Operation)),
     %% Set default values after validating input, so admin can be set to false
     %% if it is not present
     User1 = set_default_values(User, ?DEFAULT_FIELD_VALUES),
  
positive.code: 
  -export([assemble_user_ejson/2,
           parse_binary_json/1,
           password_data/1,
           set_key_pair/3,
           set_password_data/2,
  
negative.code:           {<<"admin">>, false}
          ]).
  
  user_spec()->
      user_spec(create).
  user_spec(create) ->
    {[
      {<<"name">>, {string_match, chef_regex:regex_for(user_name)}},
      {<<"password">>, {fun_match, {fun valid_password/1, string, <<"Password must have at least 6 characters">>}}},
      {{opt,<<"admin">>}, boolean}
     ]};
  user_spec(update) ->
    {[
      {<<"name">>, {string_match, chef_regex:regex_for(user_name)}},
      {{opt,<<"password">>}, {fun_match, {fun valid_password/1, string, <<"Password must have at least 6 characters">>}}},
      {{opt,<<"admin">>}, boolean}
     ]}.
  
  