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
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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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.