cancel
Showing results for 
Search instead for 
Did you mean: 

CAPM Deserialization Error: Value for structural type must be an object

sahu101
Explorer
0 Kudos
1,324

I have the following schema for a CAPM application in nodejs.

I have the following schema for a dummy CAPM application in nodejs.

entity Orders : managed {
key id : UUID;
name : String;
description : String;
total_amt : Decimal(7, 2);
orderItem : Composition of many OrderItems
on orderItem.order = $self;
}
entity OrderItems : managed {
key id : UUID;
description : String;
amount : Decimal(7, 2);
quantity : Int16;
order : Association to Orders;
item : Composition of Books
on item.orderItem = $self;
}
entity Books : managed {
key id : UUID;
name : String;
isbn : String;
author : String;
publisher : String;
price : Decimal(7, 2);
currency : Currency;
orderItem : Association to OrderItems;
}
It has 3 layers of parent-child relationship. Following is the POST request body.
{
"name": "hgf",
"description": "ono",
"total_amt": 20.00,
"orderItem": [
{
"description": "iu",
"amount": 10.00,
"quantity": 2,
"item": {
"name" : "muk7i",
"isbn" : "ryh",
"author" : "ewfewf",
"publisher" : "qwdq",
"price" : 10.00,
"currency" : "INR"
}
},
{
"description": "mj",
"amount": 10.00,
"quantity": 1,
"item": {
"name" : "i8nty",
"isbn" : "wdqedd",
"author" : "465g",
"publisher" : "rb4",
"price" : 5.00,
"currency" : "INR"
}
}
]
}
after firing the POST request I get the following error:
{
"error": {
"code": "400",
"message": "Deserialization Error: Value for structural type must be an object."
}
}
What could be the cause of this error? My guess is that I am not correctly defining multi-level relationships between entities.
gregorw
Active Contributor
0 Kudos

But why would you make Book an composition and not an association?

Accepted Solutions (1)

Accepted Solutions (1)

Dinu
Contributor
0 Kudos

Error is in data

"currency" :{"code":"INR"}
instead of
 "currency" : "INR"
kunalchauhan
Explorer
0 Kudos

Hey Dinu!

We are working with Cap project and Build Process automation , in which we are trying to post data to Hana Cloud DB .
we are facing the same issue. we are using actions in BPA to post data.
our Request Payload structure is this .

kunalchauhan_0-1721998839841.png

we are facing this issue.

kunalchauhan_1-1721998871919.png


could you provide any input regarding this, till few days ago it worked fine with the same payload suddenly we are getting error.

Many Thanks in advance.

Best Regards,
Kunal

kunalchauhan
Explorer
0 Kudos

.

Answers (0)