+ Start a Discussion

Apex Type unsupported in JSON: Schema.DescribeFieldResult (CS1 only)

I am using JSON.serialize() to output some custom classes JavaScript to a Page.  I am serializing a custom class and that class has a transient property that includes the Schema.DescribeFieldResult object.


On every instance I have access to (except CS1), it serializes fine.  On CS1, I get the error Apex Type unsupported in JSON: Schema.DescribeFieldResult.




I am hoping CS1 is out of date and just needs an update.  I am worried, though, that CS1 has newer code and I will start seeing this issue on other instances in the near future.


I was able to recreate the issue on other instances by removing the transient keyword from my property.  When I did, the JSON.serialize() failed.  When I made the property transient again, it worked.  


It appears that CS1 is ignoring that the property is transient and is trying to serialize it anyway.  Seems like a bug on CS1.