-
-
Notifications
You must be signed in to change notification settings - Fork 11
Error when record class has an object type property #84
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
Comments
The response from js layer is Actual error in js layer:
Value received in js layer:
Looks like
|
I'm looking into it. |
Okay I replicated the issue, and it's incredibly odd. I'm not string editing the JSON serialization, but here's the JSON that was passed to the universal translation layer: '[{"Databases":{},"TestIntStable":1,"TestIntStable2":10,"Nested":{"value":"abc"},"_id":1,"guid1":"00000000-0000-0000-0000-000000000000","guid2":"00000000-0000-0000-0000-000000000000","Name":"Zack","Age":45,"TestInt":9,"DateOfBirth":null,"guid":"c9779e79-98e5-436a-b04e-ccab71673a93","Secret":null,"Payload":"testPrivate":false,"Access":1},{"Databases":{},"TestIntStable":2,"TestIntStable2":10,"Nested":{"value":"abc"},"_id":2,"guid1":"00000000-0000-0000-0000-000000000000","guid2":"00000000-0000-0000…estInt":90,"DateOfBirth":null,"guid":"3fac8aa9-95fb-4ed1-aded-8c23332e63ca","Secret":null,"Payload":"testPrivate":false,"Access":0},{"Databases":{},"TestIntStable":44,"TestIntStable2":10,"Nested":{"value":"abc"},"_id":44,"guid1":"00000000-0000-0000-0000-000000000000","guid2":"00000000-0000-0000-0000-000000000000","Name":"Zane","Age":47,"TestInt":101,"DateOfBirth":"2020-02-10T00:00:00.0000000","guid":"a3e2801f-7949-4c6b-9b01-551720e5d1a2","Secret":null,"Payload":"testPrivate":false,"Access":0}]' And what came in was, Very very odd. Obviously it's the custom built serializer, but it's still utilizing System.Json.Text so this is weird. But since I know where this has to be originating from, I can resolve this. |
@saulgaray0131 Just know I haven't forgotten! I've just been really busy with dumb adult responsibilities this week. Taxes, business, resolving the worlds problems quietly behind the scenes. The normal! But, I did get pretty far into resolving this. It comes down to how my serializer handles But the issue is that the Therefore, I have to add an exception to the rule. An This is why it's serializing an object as if it was simple, which is why the syntax is broken. It can handle a strictly typed nested class, but a dynamically created object throws the serializer off. This is a recognized bug that will be resolved. It's not a hard thing to resolve, just tedious as I need to change various layers on how I handle this. TLDR: I need to make sure I inspect the property with runtime reflections of any provided object type to validate if it is a simple or complex property. |
Not able to have an object property in a record class.
Tested using the test server project by adding an object type property to Person class.
Error:
The text was updated successfully, but these errors were encountered: