Error with JsonProperty

33 views
Skip to first unread message

William Grymuza

unread,
Jun 26, 2025, 11:12:31 AMJun 26
to Illuminated Cloud Q&A
Hi.

I have an apex class with inner class:
Screenshot 2025-06-26 134317.png

the code is being highlighted as an error: 
@JsonProperty: Cannot resolve symbol JsonProperty
Screenshot 2025-06-26 123427.png

Can someone advise if this is a bug, missing feature of a configuration issue I have?

Thanks, 
William

Scott

unread,
Jun 26, 2025, 11:16:40 AMJun 26
to Illuminated Cloud Q&A, william...@circet.co.uk

Hi, William. Apologies that your original message(s) didn’t post, but posting access in this group requires moderation after receiving quite a bit of spam. Future posts should not require approval. I’ve de-duplicated your posts into this one.

I wasn’t aware of an @JsonProperty annotation in Apex, only @JsonAccess. I don’t see any references to it via search either. Can you please provide a link to the documentation? Once that’s done, I’ll be happy to update IC’s Apex parser for it.

Regards,
Scott Wells

Message has been deleted

Scott

unread,
Jun 26, 2025, 11:49:47 AMJun 26
to Illuminated Cloud Q&A, Scott, william...@circet.co.uk

While I can’t find concrete documentation, I’ve added support for it as shown in your screenshot…and confirmed in my own usage locally, specifically @JsonProperty(<apexStringLiteral>) on a field or property. Running tests now, but pending successful execution, that will be included in today’s build.

Regards,
Scott Wells

Scott

unread,
Jun 26, 2025, 12:32:00 PMJun 26
to Illuminated Cloud Q&A, Scott, william...@circet.co.uk

This has been delivered in 2.3.6.3. Please let me know if the issue is not resolved after updating.

Regards,
Scott Wells

William Grymuza

unread,
Jun 27, 2025, 3:27:50 AMJun 27
to Illuminated Cloud Q&A, Scott, William Grymuza
Thanks Scott, that has worked beautifully. 

I cannot find any solid docs about it myself. ChatGPT suggested to use it when I as looking into parsing of JSON with '__c' in the key names. Since quick google returned solid docs for it (just not for SF) I added it and it worked. Not even for a moment I questioned if it's implemented in SF. Since no IDE is perfect, and I'm deploying on save it was very quick to test in single line: add it, save and see if it deployed. That worked, so I took it from there. 

I'm running deep search in GPT atm, trying to find any references to when this might have been added. I'll let you know when I have something sensible back. 

Much appreciated for quick turnaround, I can confirm that 2.3.6.3. works for me and those are no longer listed under 'errors'. 

Thanks, 
William

William Grymuza

unread,
Jun 27, 2025, 3:35:37 AMJun 27
to Illuminated Cloud Q&A, William Grymuza, Scott
Hi Scott. 

I got response from GPT (attached). 

Hope that helps.

Cheers, 
William

@JsonProperty Annotation in Salesforce Apex.pdf
Reply all
Reply to author
Forward
0 new messages