Don't pass default is_optional value to get_json_object_string_field.
This commit is contained in:
parent
abbeffe964
commit
d9a4e5572f
@ -132,12 +132,12 @@ Result<Address> address_from_json(Slice json) {
|
||||
}
|
||||
|
||||
auto &object = value.get_object();
|
||||
TRY_RESULT(country_code, get_json_object_string_field(object, "country_code", true));
|
||||
TRY_RESULT(state, get_json_object_string_field(object, "state", true));
|
||||
TRY_RESULT(city, get_json_object_string_field(object, "city", true));
|
||||
TRY_RESULT(street_line1, get_json_object_string_field(object, "street_line1", true));
|
||||
TRY_RESULT(street_line2, get_json_object_string_field(object, "street_line2", true));
|
||||
TRY_RESULT(postal_code, get_json_object_string_field(object, "post_code", true));
|
||||
TRY_RESULT(country_code, get_json_object_string_field(object, "country_code"));
|
||||
TRY_RESULT(state, get_json_object_string_field(object, "state"));
|
||||
TRY_RESULT(city, get_json_object_string_field(object, "city"));
|
||||
TRY_RESULT(street_line1, get_json_object_string_field(object, "street_line1"));
|
||||
TRY_RESULT(street_line2, get_json_object_string_field(object, "street_line2"));
|
||||
TRY_RESULT(postal_code, get_json_object_string_field(object, "post_code"));
|
||||
|
||||
TRY_STATUS(check_country_code(country_code));
|
||||
TRY_STATUS(check_state(state));
|
||||
|
@ -802,19 +802,19 @@ static Result<td_api::object_ptr<td_api::personalDetails>> get_personal_details_
|
||||
}
|
||||
|
||||
auto &object = value.get_object();
|
||||
TRY_RESULT(first_name, get_json_object_string_field(object, "first_name", true));
|
||||
TRY_RESULT(middle_name, get_json_object_string_field(object, "middle_name", true));
|
||||
TRY_RESULT(last_name, get_json_object_string_field(object, "last_name", true));
|
||||
TRY_RESULT(native_first_name, get_json_object_string_field(object, "first_name_native", true));
|
||||
TRY_RESULT(native_middle_name, get_json_object_string_field(object, "middle_name_native", true));
|
||||
TRY_RESULT(native_last_name, get_json_object_string_field(object, "last_name_native", true));
|
||||
TRY_RESULT(birthdate, get_json_object_string_field(object, "birth_date", true));
|
||||
TRY_RESULT(first_name, get_json_object_string_field(object, "first_name"));
|
||||
TRY_RESULT(middle_name, get_json_object_string_field(object, "middle_name"));
|
||||
TRY_RESULT(last_name, get_json_object_string_field(object, "last_name"));
|
||||
TRY_RESULT(native_first_name, get_json_object_string_field(object, "first_name_native"));
|
||||
TRY_RESULT(native_middle_name, get_json_object_string_field(object, "middle_name_native"));
|
||||
TRY_RESULT(native_last_name, get_json_object_string_field(object, "last_name_native"));
|
||||
TRY_RESULT(birthdate, get_json_object_string_field(object, "birth_date"));
|
||||
if (birthdate.empty()) {
|
||||
return Status::Error(400, "Birthdate must be non-empty");
|
||||
}
|
||||
TRY_RESULT(gender, get_json_object_string_field(object, "gender", true));
|
||||
TRY_RESULT(country_code, get_json_object_string_field(object, "country_code", true));
|
||||
TRY_RESULT(residence_country_code, get_json_object_string_field(object, "residence_country_code", true));
|
||||
TRY_RESULT(gender, get_json_object_string_field(object, "gender"));
|
||||
TRY_RESULT(country_code, get_json_object_string_field(object, "country_code"));
|
||||
TRY_RESULT(residence_country_code, get_json_object_string_field(object, "residence_country_code"));
|
||||
|
||||
TRY_STATUS(check_name(first_name));
|
||||
TRY_STATUS(check_name(middle_name));
|
||||
@ -936,8 +936,8 @@ static Result<td_api::object_ptr<td_api::identityDocument>> get_identity_documen
|
||||
}
|
||||
|
||||
auto &object = json_value.get_object();
|
||||
TRY_RESULT(number, get_json_object_string_field(object, "document_no", true));
|
||||
TRY_RESULT(expiry_date, get_json_object_string_field(object, "expiry_date", true));
|
||||
TRY_RESULT(number, get_json_object_string_field(object, "document_no"));
|
||||
TRY_RESULT(expiry_date, get_json_object_string_field(object, "expiry_date"));
|
||||
|
||||
TRY_STATUS(check_document_number(number));
|
||||
TRY_RESULT(date, get_date_object(expiry_date));
|
||||
|
Loading…
Reference in New Issue
Block a user