Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

0

Found in

2017.4.0f1

2018.4.0f1

2019.1.0a1

2019.1.9f1

2019.2.0a1

2019.3.0a1

Issue ID

1168567

Regression

No

No error message is raised for omission of the attribute [Serializable] for JSON class declaration and JSON deserialization

Serialization

-

How to reproduce:
1. Open user-submitted project (685223.zip)
2. Open the 'SampleScene' scene
3. Enter Play Mode, observe that JSON object values are printed in the Console window
4. Open the 'JsonTest.cs' script and remove/comment out all [Serializable] attributes
5. Return to the Editor and enter Play Mode

Expected result: deserialization failure to generate the object is logged in the Console window
Actual result: deserialization failure is not reported, there is no way of knowing that the deserialization has failed to generate the object without the Debug.Log message

Reproducible with: 2017.4.30f1, 2018.4.4f1, 2019.1.10f1, 2019.2.0b9, 2019.3.0a9

Notes:
NullReferenceException error when entering Play Mode without [Serializable] attributes in the script is expected, since the objects are not generated correctly

  1. Resolution Note:

    This is a feature request to provide better error messages for JsonUtility when serialization fails due to missing [Serializable] attribute on fields.

    Since adding error handling requires changes to underlying serialization system used everywhere in Unity, this is a non-trivial and major undertaking. We have therefore postponed fixing of this issue and put it our backlog as a future improvement.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.