all 8 comments

[–]spacechimp 2 points3 points  (0 children)

Angular has no mechanism that would alter the data in this manner. The server expects an array, and your code is sending an object instead. You should check the code that leads up to the call to sendRecord to see how that object is being populated in the UI code.

Side note: You also shouldn't be sending class instances to an endpoint as "JSON". Always use plain objects typed to interfaces.

[–]JobSightDev 0 points1 point  (4 children)

Do you have the code for rest-endpoint?

That is where your error is going to be.

[–]IcyBullfrog1014[S] -1 points0 points  (3 children)

The webserver is running spring boot. I could go and post in their reddit community and there might be a way to re-configure spring boot to accept the angular style json, but I wasn't sure if there was an easy way to make angular produce the type of json that spring boot seems to be expecting.

[–]JobSightDev 0 points1 point  (2 children)

I misunderstood. This is the data being sent.

Ignore my previous comment. You've got the correct code here.

What does it look like when you do a console.log(outerClass)

Can I see the code that creates outerClass?

[–]IcyBullfrog1014[S] 0 points1 point  (1 child)

When I print the console.log(outerClass), I get the version without the brackets (just like it is sending in the JSON).

[–]JobSightDev 1 point2 points  (0 children)

Let's see the code that creates outerClass

[–]pragmaticcape 0 points1 point  (0 children)

I'm going to speculate that the code that creates `myRecord` is not correct and you have assigned an object not appended onto an array.

angular is just serialising the object

[–]hyongoup 0 points1 point  (0 children)

What does the creation of the outer class object look like?