Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate attribute in JSON output (utf8-branch only) #72

Open
m1h43l opened this issue Nov 10, 2022 · 0 comments
Open

Duplicate attribute in JSON output (utf8-branch only) #72

m1h43l opened this issue Nov 10, 2022 · 0 comments

Comments

@m1h43l
Copy link
Contributor

m1h43l commented Nov 10, 2022

Using short attribute names in the node path expression leads to duplicate attribute nodes in the graph and in the JSON output.

dcl-proc main;
  dcl-s json pointer;
  dcl-s msg char(50);
  
  json = nox_newObject();
  nox_setStr(json : 'auth/type' : 'bearer');
  nox_setStr(json : 'auth/token' : 'token');
  msg = nox_asJsonText(json);
  dsply msg;
  nox_close(json);

  json = nox_newObject();
  nox_setStr(json : 'authorization/type' : 'bearer');
  nox_setStr(json : 'authorization/token' : 'token');
  msg = nox_asJsonText(json);
  dsply msg;
  nox_close(json);
end-proc;

Output:

DSPLY  {"auth":{"type":"bearer","token":"token"}}        
DSPLY  {"authorization":{"type":"bearer"},"authorization"

Note: The output is capped at 50 chars but we can see that the attribute authorization is outputted two times which is invalid JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant