Skip to content

Commit 7420d84

Browse files
committed
fix: keep deprecated field
1 parent a88f175 commit 7420d84

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/#apmg#cl_package_json.clas.abap

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ CLASS /apmg/cl_package_json DEFINITION
8383
!manifest TYPE /apmg/if_types=>ty_manifest
8484
!is_package_json TYPE abap_bool DEFAULT abap_false
8585
!is_complete TYPE abap_bool DEFAULT abap_false
86+
!is_deprecated TYPE abap_bool DEFAULT abap_false
8687
RETURNING
8788
VALUE(result) TYPE string
8889
RAISING
@@ -294,7 +295,7 @@ CLASS /apmg/cl_package_json IMPLEMENTATION.
294295
cpu TYPE string_table,
295296
db TYPE string_table,
296297
private TYPE abap_bool,
297-
deprecated TYPE abap_bool,
298+
deprecated TYPE string,
298299
dist TYPE /apmg/if_types=>ty_dist,
299300
readme TYPE string,
300301
sap_package TYPE /apmg/if_types=>ty_sap_package,
@@ -410,7 +411,9 @@ CLASS /apmg/cl_package_json IMPLEMENTATION.
410411
iv_val = dependency-range ).
411412
ENDLOOP.
412413

413-
IF is_complete = abap_false.
414+
IF is_deprecated = abap_true.
415+
ajson = ajson->filter( /apmg/cl_ajson_extensions=>filter_deprecated( ) ).
416+
ELSEIF is_complete = abap_false.
414417
ajson = ajson->filter( /apmg/cl_ajson_extensions=>filter_empty_zero_null( ) ).
415418
IF manifest-private = abap_false.
416419
INSERT `/private` INTO TABLE skip_paths.

src/#apmg#cl_package_json.clas.testclasses.abap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ CLASS ltcl_package_json IMPLEMENTATION.
253253
&& `| }`
254254
&& `| ]`
255255
&& `| },`
256-
&& `| "deprecated": true,`
256+
&& `| "deprecated": "This package is deprecated",`
257257
&& `| "_id": "[email protected]",`
258258
&& `| "_abapVersion": "7.54.0",`
259259
&& `| "_apmVersion": "1.0.0"`
@@ -304,7 +304,7 @@ CLASS ltcl_package_json IMPLEMENTATION.
304304
&& `| }`
305305
&& `| ]`
306306
&& `| },`
307-
&& `| "deprecated": true`
307+
&& `| "deprecated": "This package is deprecated"`
308308
&& `|}`.
309309

310310
test_json = prepare_string( test_json ).
@@ -361,7 +361,7 @@ CLASS ltcl_package_json IMPLEMENTATION.
361361

362362
test_manifest = CORRESPONDING #( test_package_json ).
363363

364-
test_manifest-deprecated = abap_true.
364+
test_manifest-deprecated = 'This package is deprecated'.
365365
test_manifest-dist = VALUE #(
366366
file_count = 8
367367
integrity = `edge`

0 commit comments

Comments
 (0)