Closed IrwinHorowitz closed 3 years ago
Hi @IrwinHorowitz! I was very confused by this issue at first, but then I realized what's going on.
I think you are using the native Apex class called JSONParser and documented here (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_JsonParser.htm).
This Github repository is for a custom Apex class with a similar name but it is not the first-party class that Salesforce built.
So sorry grekker. This is where I should be https://github.com/superfell/json2apex/issues. They built an apex class builder for parsing json. http://json2apex.herokuapp.com/ . My apologies again. I'll blame google and my not paying enough attention.
Irwin
On Thu, Oct 14, 2021 at 6:27 PM grekker @.***> wrote:
Hi @IrwinHorowitz https://github.com/IrwinHorowitz! I was very confused by this issue at first, but then I realized what's going on.
I think you are using the native Apex class called JSONParser and documented here ( https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_JsonParser.htm ).
This Github repository is for a custom Apex class with a similar name but it is not the first-party class that Salesforce built.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/open-force/jsonparse/issues/5#issuecomment-943786097, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIL2535KPE4ZN6AAQKSTZODUG5KMLANCNFSM5EUBVWEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
-- Irwin Horowitz Solutions Architect
28 West 23rd Street New York, NY 10010 (845) 803-6996
No worries! While you're here you should check out this library, might come in handy for you sometime :)
the local instance of 'text' was assigned instead of the this.text when 'text' is an entity in the parsed json. Possibly make your String text field unique by naming it j2a_text or something like that or use the this.text in the assignment. Below I did both to resolve the issue. Thanks for this great utility.
public class Fields { public String description {get;set;} public Boolean required {get;set;} public String text {get;set;} public String type {get;set;} public String id {get;set;} public String value {get;set;} public List options {get;set;}
public String prompt {get;set;}