REST API Response with custom JSON String containing invalid characters when ran in the IBMi
Posted: Tue Oct 08, 2024 12:54 pm
Good day,
I've encountered an issue that only happens when running REST APIs in the IBMi with the response being a custom JSON string.

The reason I went with a custom JSON String is because the array needs to be built dynamically based on data and the number of levels vary. It was a lot easier to work with it as a String rather than nested objects / arrays which kept crashing VL.
When the REST API is ran using an IIS webserver, the response does not contain the gibberish data.
So my questions would be:
1. Has anyone encountered the same issue with a custom JSON response when running REST APIs in the IBMi?
2. Is it possible to build a dynamic nested array using schema objects in the API definition?
Thanks for the help!
I've encountered an issue that only happens when running REST APIs in the IBMi with the response being a custom JSON string.

Code: Select all
#uContext.Response.HttpStatus := 200
#uContext.Response.ContentType := "application/json"
#uContext.Response.ContentString := #uStringWriter.Text
When the REST API is ran using an IIS webserver, the response does not contain the gibberish data.
So my questions would be:
1. Has anyone encountered the same issue with a custom JSON response when running REST APIs in the IBMi?
2. Is it possible to build a dynamic nested array using schema objects in the API definition?
Thanks for the help!

