Enabling Lenient JSON Parsing for Import Mappings - Mendix Forum

Enabling Lenient JSON Parsing for Import Mappings

0

Hi All,

I would like to share a Feedback / Idea around Import Mapping JSON Parsing.


Expose a setting to optionally enable lenient JSON parsing, allowing things like trailing commas for cases where source system is not fully spec compliant but the payload is otherwise usable.


Since lot of import mappings are fed by external system that we don't control, small formatting issues can show up eventually.


This lenient parsing option can help to avoid those unnecessary import failures for formatting issues that does not affect the data itself.

Please share your thoughts!

Best Regards,
Amit Gupta

asked
2 answers

Hi Joost,


Lenient parsing basically means telling the parser to relax strict syntax rules (like RFC 8259 for JSON) so it does not fail when it encounters small formatting issues. Instead of throwing an error, it can accept and processes the payload.


A example i can think of is the Jackson library in Java. Jackson lets you configure the objectMapper with feature flags to tolerate things like:


  • Unquoted keys
  • Single quotes around strings or keys
  • Trailing commas
  • Comments

Since Mendix already uses Jackson under the hood, adding "Enable Lenient Parsing" checkbox on Import Mappings would save developers from having to build custom Java actions just to sanitize incoming payloads.


Another big use case right now is LLMs. AI generated JSON might contains small syntax issues like trailing comma or single quotes. Having built-in lenient parsing would make working with AI responses much easier, atleast that is what i think so.

Created

My main question would be what the precise definition of lenient parsing is. Do you have examples of systems or libraries that have that option?

Created