AL icon indicating copy to clipboard operation
AL copied to clipboard

API - json body with nested nodes

Open marioemme opened this issue 7 years ago • 2 comments

Hi all,

I tried to create a web API extension in Dynamic 365 BC (Spring 2019 version) that accept a json body with nested nodes. To do this I created three API pages with this structure:

  • The "page 2" as part of "page 1"

  • The "page 3" as part of the "page 2"

During the test with Postman I had the follow results:

  1. I don’t have problem with the GET method, in fact the all json is displayed correctly (with data and the nested nodes)

  2. When I try to send a POST I don't have error but only the sourcetables of the "page 1" and "page 2" are written. It is like that the last node array is ignored. This is the problem that I have.

Is it possible to create API that accept a json body with more nested nodes (3,4 o more)? Someone have some idea about my issue?

Thanks!

PS: This is the body that my "mock" API should accept: { "no": "TEST001", "description": "this is test 001", "lines": [ { "lineNo": 10000, "lineDescription": "this is test 001 line", "sublines": [ { "sublineNo": 10000, "subLineDescription": "this is test 001 subline" } ] } ] }

marioemme avatar Jun 02 '19 23:06 marioemme

for "page 2" & "page 3", probably you defined as part page on "page 1" and "page 2" respectively. on definition of that, the id or name of the part page must be same with the "entitySetName" property value.

see the screen shot:

image

try this and then it will work fine and then let me know

SahilGuptaBS avatar Jun 17 '19 10:06 SahilGuptaBS

Thank you. We're aware of this and is actively working on enabling deeper level nesting. Same issue is reported on aka.ms/bcideas.

henrikwh avatar Jun 19 '19 11:06 henrikwh