Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Objects and arrays #7

Open
Edward-Teach opened this issue Mar 22, 2023 · 7 comments
Open

Nested Objects and arrays #7

Edward-Teach opened this issue Mar 22, 2023 · 7 comments

Comments

@Edward-Teach
Copy link

Hello,
If I place an array of structures, using the Struct 2Json node, the engine crashes.

I have to change server response to pass somethings like { "data": [ ...]} instead of [...] . (Wrapping the array inside a new structure)

Anyway, If I use a structure like this: StructData: { "data": "obj_1" array} SructObj1: { "name": string, config: "obj_2" array}
the plugins only retrieve data for the parent object.. all children are ignored, this means that I lose all relations.

@DAN-AND-DNA
Copy link
Owner

Unreal 4.27

image
image
image

@DAN-AND-DNA
Copy link
Owner

image
@Edward-Teach Hi, only User Defined Struct is supported

@Edward-Teach
Copy link
Author

Edward-Teach commented Mar 22, 2023

Hey @DAN-AND-DNA :) thanks for the quick reply.
Ye I'm using User Defined Structure

I'v something like this

  • structure 1
  • structure 2
  • structure 3
structure_1 {
  id: int,
  name: string,
  str: structure_2 
}

structure 2{
  id: int,
  title: string,
  values: (array of) structure_3
}

structure 3{
  id: int,
  url: string
}

And this is an example of json response I receive from my server:

{
   "objects":   [
      {
         id: 1,
         name: 'test',
         str: {
              id: 3,
              title: 'title_ex',
             values: [
                   {
                        id: 1,
                        url: 'http://..'
                   },
                   {
                        id: 2,
                        url: 'http://..'
                   }
            ]
         }
      }
  ]
}

When I parse the structure_1, it only extract the id and name, not the structure_2

@DAN-AND-DNA
Copy link
Owner

ue 4.27
image
image
image
image
image

@DAN-AND-DNA
Copy link
Owner

@Edward-Teach I've tried it and it seems to work

@DAN-AND-DNA
Copy link
Owner

Are there any errors in the logs?

@DAN-AND-DNA
Copy link
Owner

image
image
The S1 arrays can also be parsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants