Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@abaplint/cli": "^2.113.233",
"@abaplint/database-pg": "^2.11.78",
"@abaplint/database-sqlite": "^2.11.78",
"@abaplint/runtime": "^2.12.5",
"@abaplint/transpiler-cli": "^2.12.5",
"@abaplint/runtime": "^2.12.7",
"@abaplint/transpiler-cli": "^2.12.7",
"0x": "^6.0.0"
}
}
3 changes: 2 additions & 1 deletion src/json/#ui2#cl_json.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ CLASS /ui2/cl_json IMPLEMENTATION.
FIELD-SYMBOLS <ls_component> LIKE LINE OF lt_components.

prefix = mo_parsed->find_ignore_case( prefix ).

* WRITE '@KERNEL console.dir(lo_type.get());'.
CASE io_type->kind.
WHEN cl_abap_typedescr=>kind_elem.
Expand All @@ -368,6 +367,8 @@ CLASS /ui2/cl_json IMPLEMENTATION.
ELSE.
data = lv_value.
ENDIF.
ELSEIF io_type->type_kind = cl_abap_typedescr=>typekind_xstring.
data = cl_http_utility=>decode_x_base64( mo_parsed->value_string( prefix ) ).
ELSEIF io_type->type_kind = cl_abap_typedescr=>typekind_time.
lv_value = mo_parsed->value_string( prefix ).
REPLACE ALL OCCURRENCES OF ':' IN lv_value WITH ''.
Expand Down
22 changes: 22 additions & 0 deletions src/json/#ui2#cl_json.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ CLASS ltcl_serialize DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT F
METHODS numc_field2 FOR TESTING RAISING cx_static_check.
METHODS serialize_empty_xstring FOR TESTING RAISING cx_static_check.
METHODS serialize_xstring FOR TESTING RAISING cx_static_check.
METHODS xstring_identity FOR TESTING RAISING cx_static_check.
ENDCLASS.

CLASS ltcl_serialize IMPLEMENTATION.
Expand Down Expand Up @@ -720,6 +721,27 @@ CLASS ltcl_serialize IMPLEMENTATION.
exp = '{"FOO":"qg=="}' ).
ENDMETHOD.

METHOD xstring_identity.
DATA: BEGIN OF is_metadata,
foo TYPE xstring,
END OF is_metadata.
DATA lv_json TYPE string.
is_metadata-foo = 'AA'.
lv_json = /ui2/cl_json=>serialize( is_metadata ).

CLEAR is_metadata.

/ui2/cl_json=>deserialize(
EXPORTING
json = lv_json
CHANGING
data = is_metadata ).

cl_abap_unit_assert=>assert_equals(
act = is_metadata-foo
exp = 'AA' ).
ENDMETHOD.

METHOD bool_false.
DATA: BEGIN OF ls_data,
foo_bar TYPE abap_bool,
Expand Down