Showing results for 
Search instead for 
Did you mean: 

How to process an array of a complex type in an ODATAV4 API

0 Kudos

I have the following challenge which i have to solve in my ODATAV4 API.

I want to POST data to create a contract.
My request body looks like this

{ "contractname" : "test",

    "Price": {
      "totalamount" : "10",
      "discounts": [
          "Type": {
            "maintype": "justAmaintype",
            "subtype": "justAsubtype"

As you can see the discounts is an array of a complex type

How can i define this in my MPC class.
I do not see an possibility to create a complex type as an array.
I can solve it somehow with entity, entityset and navigation, but i do not this this should be the correct way. as i see entities as resources in the API.

Thanks in advance for the help!

Kind regards,
Peter van Alphen

Accepted Solutions (0)

Answers (0)