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

issue_186 #187

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/core/zcl_ajson.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3748,6 +3748,7 @@
methods chaining for testing raising zcx_ajson_error.
methods push_json for testing raising zcx_ajson_error.
methods is_empty for testing raising zcx_ajson_error.
methods issue_186 for testing raising zcx_ajson_error.

endclass.

Expand Down Expand Up @@ -4073,6 +4074,39 @@

endmethod.

method issue_186.

types:
begin of ty_contact,
id type string,
email type string,
end of ty_contact,
ty_contacts type standard table of ty_contact with key id,
begin of ty_person,
name type string,
email type ty_contacts,
end of ty_person,
ty_persons type standard table of ty_person with key name.

data li_json1 type ref to zif_ajson.
data li_jsona type ref to zif_ajson.
data ls_act type ty_person.
* data ls_exp type ty_person.

Check failure on line 4094 in src/core/zcl_ajson.clas.testclasses.abap

View check run for this annotation

abaplint / abaplint

Commented code

https://rules.abaplint.org/commented_code
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code

Suggest following fix,

Suggested change
* data ls_exp type ty_person.

data lt_act type ty_persons.
* data lt_exp type ty_persons.

Check failure on line 4096 in src/core/zcl_ajson.clas.testclasses.abap

View check run for this annotation

abaplint / abaplint

Commented code

https://rules.abaplint.org/commented_code

li_json1 = zcl_ajson=>parse( '{ "name": "A",' &&
'"email": [ { "id": "1", "email": "[email protected]" }, { "id": "2", "email": "[email protected]" } ] }' ).
li_jsona = zcl_ajson=>parse( '[' &&
'{ "name": "A", "email": [ { "id": "1", "email": "[email protected]" }, { "id": "2", "email": "[email protected]" } ] },' &&
'{ "name": "B", "email": [ { "id": "3", "email": "[email protected]" }, { "id": "4", "email": "[email protected]" } ] }' &&
']' ).

li_json1->to_abap( importing ev_container = ls_act ).
li_jsona->to_abap( importing ev_container = lt_act ).

endmethod.

endclass.

**********************************************************************
Expand Down
Loading