Skip to content

il_responseWriteStream returns incomplete JSON #106

Description

@SteffenHaugeKtp

I made a simple program that selects every from a file and returns it as JSON via noxDB.

Following the example file: noxdbcust.rpgle

`dcl-proc jsonTest;

dcl-pi *n;
    request  likeds(IL_REQUEST);
    response likeds(IL_RESPONSE);
end-pi;

dcl-s pResult pointer;

// Assume everything is OK
response.status = 200;
response.contentType = 'application/json';

// Use noxDB to produce a JSON resultset to return
pResult = json_sqlResultSet ('select * from MY_FILE');

// Use the stream to input data from noxdb and output it to ILEastic
il_responseWriteStream(response:json_stream(pResult));

end-proc;`

But it seems to return invalid JSON, it looks like its getting cut off at the end, sometimes?
It seems to occur if i select enough data from a single file.

If i use json_writejsonstmf to dump the data to a IFS file it's correct.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions