virtyaluk / InTouch

:busts_in_silhouette: InTouch - is a programming SDK build around vk.com API exposing most of the social platform features including messaging, news feed fetching, communities, and media management.
GNU General Public License v3.0
33 stars 14 forks source link

Ошибка парсинга данных пользователя #26

Open dpr-dev opened 7 years ago

dpr-dev commented 7 years ago

При запросе Request к хранимой процедуре, которая возвращает объект User, вываливается исключение Newtonsoft.Json.JsonSerializationException, если в списке полей (fields) был параметр exports.

virtyaluk commented 7 years ago

@Arthur1PO-14, приведите, пожалуйста, примеры кода, где происходит исключение.

dpr-dev commented 7 years ago

Прошу прощения за то, что долго не отвечал. Вот в этой хранимой процедуре вываливается исключение. Если убрать exports из списка дополнительных полей - всё отрабатывает.

var user_id = Args.uid, 
    v = 5.64;

var users = API.users.get({
    user_ids: user_id, 
    fields: "exports,counters,maiden_name,military,blacklisted,blacklisted_by_me,crop_photo,is_friend,friend_status,career,is_favorite,is_hidden_from_feed,timezone,screen_name,can_write_private_message,can_send_friend_request,can_post,can_see_all_posts,can_see_audio,music,movies,tv,books,games,about,quotes,interests,activities,wall_comments,connections,personal,common_count,occupation,nickname,relatives,relation,site,education,universities,schools,status,last_seen,followers_count,photo_max_orig,online,domain,has_mobile,contacts,verified,bdate,sex,country,photo_id,city,home_town,has_photo,photo_100,photo_200_orig,photo_200,photo_400_orig,photo_max", 
    v: v
}); 
return users[0];

Код на клиенте:

private Task<Response<User>> GetUserInfoAsync(int id) =>
            _inTouch.Request<User>("execute.getUserInfo", new Dictionary<string, string>
            {
                { "uid", $"{id}" }
            });