Задать вопрос
@KonstantinVKL

TSOA. How to fix the mismatch of the request body on the server and client?

Тело запроса в postman
{
"data": {
"type": "type",
"amount": "amount",
"status": "status",
"currency": "currency",
"currency": "currency"
}

Тело запроса на сервере:
export type MercuryoCallbackPayload ={
data: {
type: string;
amount: string;
status: string;
currency: string;
};
};

Ошибка
{
"data": {
"requestBody": {
"message": "Could not match the union against any of the items. Issues: [{\"requestBody.data\":{\"message\":\"\\\"currency2\\\" is an excess property and therefore is not allowed\",\"value\":{\"currency2\":\"currency2\"}},\"requestBody.data.merchant_transaction_id\":{\"message\":\"'merchant_transaction_id' is required\"},\"requestBody.data.fiat_currency\":{\"message\":\"'fiat_currency' is required\"},\"requestBody.data.fiat_amount\":{\"message\":\"'fiat_amount' is required\"},\"requestBody.data.updated_at\":{\"message\":\"'updated_at' is required\"},\"requestBody.data.created_at\":{\"message\":\"'created_at' is required\"},\"requestBody.data.user_uuid\":{\"message\":\"'user_uuid' is required\"}},{\"requestBody\":{\"message\":\"\\\"data\\\" is an excess property and therefore is not allowed\",\"value\":{\"data\":{\"type\":\"type\",\"amount\":\"amount\",\"status\":\"status\",\"currency\":\"currency\",\"currency2\":\"currency2\"}}}}]",
"value": {
"data": {
"type": "type",
"amount": "amount",
"status": "status",
"currency": "currency",
"currency2": "currency2"
}
}
}
}
}
  • Вопрос задан
  • 89 просмотров
Подписаться 1 Средний 4 комментария
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы
Rocket Смоленск
от 80 000 до 130 000 ₽
div. Ставрополь
от 40 000 до 90 000 ₽
Wanted. Санкт-Петербург
До 220 000 ₽