Hi Team, We have an api endpoint for a client to PUSH data into our system. There data is not great, and during postman testing we receive multiple errors. { "error": { "code": "400", "message": "Error parsing JSON. Illegal unquoted character ((CTRL-CHAR, code 30)): has to be escaped using backslash to be included in string value\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 8, column: 69] Error parsing JSON. Illegal unquoted character ((CTRL-CHAR, code 30)): has to be escaped using backslash to be included in string value\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 8, column: 69]" } } The importer allows seems to allow you to setup conversion rules, but it seems to not even want to get to the converter. is there a way to convert illegal characters on our end? similarly, we have booleans, but their data contains a mixture of yes/no/empty, true/false, 0/1
asked
Jason Teunissen
1 answers
2
You could just take in an HTTP request in your published API handler Microflow, instead of applying an import mapping to the body of the request. This would give you access to the raw request body before any import mappings are applied, and then you could build your own custom parser to pull out the data.
To me it sounds like this should be treated as a defect on the consuming side of the API, instead of trying to parse the invalid JSON on the Published side. It's one thing to add a parsing Microflow to turn the value of Yes/No and 1/0 into a boolean. It's an entirely different thing to try to parse data that isn't valid JSON. You'll basically be writing a custom almost JSON parser from scratch, and I wouldn't recommend that approach. I'd push back, and have the team consuming the API fix the issue, and send valid JSON.