Hello everyone,
I'm currently working on a WINDEV 2024 project that consumes several external REST APIs. The challenge I'm facing: some APIs return JSON responses where the structure changes based on the request parameters (e.g., optional fields appear/disappear, or data types vary).
Right now I'm handling this with JSONToExtract + manual error checking for each possible field. But the code is getting messy fast — lots of IF statements and EXCEPTION blocks.
Has anyone found a cleaner way to handle dynamic or unpredictable JSON structures in WLanguage? Ideally something that:
Doesn't crash when a field is missing
Can infer types on the fly
Plays nicely with nested objects
I came across a discussion about dynamic data parsing in other environments (not WINDEV specifically) that gave me a few ideas at
https://happymodd.com.brBut I'd love to hear how this community approaches the problem natively in WINDEV. Are there built-in functions I'm overlooking? Or do you pre-process the JSON with a script before feeding it to JSONToExtract?
Thanks in advance for any pointers!