Skip to content

Commit 276e806

Browse files
mbtoolssbcgua
authored andcommitted
docs: align JSON, ABAP spelling
1 parent d0cfbee commit 276e806

File tree

12 files changed

+41
-42
lines changed

12 files changed

+41
-42
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# abap json (ajson)
66

7-
Yet another json parser/serializer for ABAP. It works with release 7.02 or higher.
7+
Yet another JSON parser/serializer for ABAP. It works with release 7.02 or higher.
88

99
- [Documentation](https://sbcgua.github.io/ajson) (or also [directly in the repo](./docsite/docs))
1010
- [Blog articles](https://sbcgua.github.io/ajson/blog)
@@ -27,10 +27,10 @@ Since v1.2.0:
2727
- also `setx` for text-based value setting like `setx( '/a/b:123' )` (useful e.g. for constants in APIs or in unit-tests)
2828
- seralization to string
2929
- freezing (read only) instance content
30-
- filtering. Create a json skipping empty values, predefined paths, or your custom filter.
30+
- filtering. Create a JSON skipping empty values, predefined paths, or your custom filter.
3131
- mapping - rule-based changing node names (e.g. snake case to camel case, upper/lower case)
3232
- iterating through the array items or object members
33-
- utility to calculate difference between 2 jsons
33+
- utility to calculate difference between 2 JSONs
3434

3535
Installed using [abapGit](https://github.com/abapGit/abapGit), see also [Installation](https://sbcgua.github.io/ajson/docs/installation) section of the documentation.
3636

changelog.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ v1.1.13, 2025-09-19
1919
+ Add set_timestampl() that supports full ISO date time format (#202, @mbtools)
2020
+ Add support for data references initialization (#201, @mbtools)
2121
+ Long timestamps support (data element timestampl) (#207, #209, @mbtools)
22-
+ Add quick check before parsing that the content is a json (#208, @mbtools)
22+
+ Add quick check before parsing that the content is a JSON (#208, @mbtools)
2323

2424
v1.1.12, 2025-06-11
2525
-------------------
@@ -50,7 +50,7 @@ v1.1.9, 2023-08-09
5050
+ iv_corresponding flag in to_abap (#161, #162, @christianguenter2)
5151
+ to_abap_corresponding_only opt flag (#161)
5252
+ Keep item order when parsing #166
53-
+ improvements in CI, unit tests in github actions thanks to abap transpiler by @larshp
53+
+ improvements in CI, unit tests in github actions thanks to ABAP transpiler by @larshp
5454
* Improve included types processing, reuse cl_abap_structdescr=>get_included_view (#168, @mathieulawnik)
5555

5656
v1.1.8, 2023-02-16
@@ -70,7 +70,7 @@ v1.1.7, 2023-01-08
7070
+ Support ENUM types (#116, @christianguenter2)
7171
+ Added zif_ajson->opts methods, to get current instance behavior parameters
7272
+ Added possibility to filter path by pattern (cp-like)
73-
+ Added possibility to acqure only corresponding fields to abap structure (#125, #8, @postavka)
73+
+ Added possibility to acqure only corresponding fields to ABAP structure (#125, #8, @postavka)
7474
* fixes in UTs to be compatible with 7.02 (#134, @schneidermic0)
7575
* code cleanups (usage of syst #135, avoid built-in names #136, @mbtools)
7676
+ added "new" method. As a replacement for "create_empty" (which might be DEPRECATED!)
@@ -81,8 +81,8 @@ v1.1.7, 2023-01-08
8181
v1.1.6, 2022-07-15
8282
------------------
8383
* fixed camel case convertion issue @jrodriguez-rc (#110)
84-
+ added is_empty method, returns true if json has no content
85-
+ added is_equal utility, returns true if 2 jsons (or json strings) are equal
84+
+ added is_empty method, returns true if JSON has no content
85+
+ added is_equal utility, returns true if 2 JSONs (or JSON strings) are equal
8686

8787
v1.1.5, 2022-05-09
8888
------------------
@@ -91,7 +91,7 @@ v1.1.5, 2022-05-09
9191
v1.1.4, 2022-05-09
9292
------------------
9393
! Changed the default datetime formatting to ISO (YYYY-MM-DD) instead of ABAP (YYYYMMDD) #101
94-
* better handling of incorrect JSON, as the native SAP parser does not properly signal if the content is json or xml (#97)
94+
* better handling of incorrect JSON, as the native SAP parser does not properly signal if the content is JSON or XML (#97)
9595
* Fix dump in case of components with initial references @mbtools (#99)
9696
* Fix `ITAB_DUPLICATE_KEY` (nested tables path) and CamelCase @mbtools (#100)
9797
* Fix issue with pushing ajson instances to an array
@@ -107,7 +107,7 @@ v1.1.2, 2021-12-24
107107

108108
v1.1.1, 2021-12-03
109109
------------------
110-
+ json filtering #71, #72 - empty values, predefined paths, generic filtering possibility
110+
+ JSON filtering #71, #72 - empty values, predefined paths, generic filtering possibility
111111
+ more boolean types autodetection @larshp
112112
+ better parser error location reporting @mbtools
113113
+ simple performance test: zajson_perf_test
@@ -121,7 +121,7 @@ v1.1.0, 2021-09-08
121121
v1.0.4, 2021-06-22
122122
------------------
123123
! BREAKING: Move types, constants to zif_ajson, also alias methods of reader/writer
124-
+ keep_item_order feature: stringify object elements in the order it appears in abap structure
124+
+ keep_item_order feature: stringify object elements in the order it appears in ABAP structure
125125
+ custom field name mappers (zif_ajson_mapping), thanks to @jrodriguez-rc
126126
+ timestamps support (get and set), @jrodriguez-rc
127127
- removed direct reference to zif_ajson_reader/writer from the main class @mbtools

docsite/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If you are using GitHub pages for hosting, this command is a convenient way to b
4545
- `npm install --save @docusaurus/plugin-client-redirects` to support redirect from `/docs/` to `/docs/intro`
4646
- redirect gh-actions to master
4747
- logo works in wip
48-
- prism `additionalLanguages: ['abap']`
48+
- prism `additionalLanguages: ['ABAP']`
4949
- add google analytics
5050
- if blog link is above `truncate` is must be complete (start with `/`), otherwise will be broken on tags page
5151
- change Repo/Settings/Pages/Source to Github actions (otherwise does not deploy from GA) - after that the pages are based on the GA artifact not the `gh-pages` branch! (TODO: maybe check how to deploy to a branch ... but maybe not)

docsite/docs/10-intro.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ sidebar_position: 10
44

55
# Introduction
66

7-
AJson is a json parser/serializer for ABAP designed with the convenience for developer in mind. It works with abap release 7.02 or higher.
7+
AJson is a JSON parser/serializer for ABAP designed with the convenience for developer in mind. It works with ABAP release 7.02 or higher.
88

99
## Features
1010

11-
- Parse json content into a flexible form, not fixed to any predefined data structure, allowing to modify the parsed data, selectively access its parts and slice subsections of it
11+
- Parse JSON content into a flexible form, not fixed to any predefined data structure, allowing to modify the parsed data, selectively access its parts and slice subsections of it
1212
- slicing can be particularly useful for REST header separation e.g. `{ "success": 1, "error": "", "payload": {...} }` where 1st level attrs are processed in one layer of your application and payload in another (and can differ from request to request)
13-
- Allows conversion to fixed abap structures/tables (`to_abap`)
13+
- Allows conversion to fixed ABAP structures/tables (`to_abap`)
1414
- Convenient interface to manipulate the data - `set( value )`, `set( structure )`, `set( table )`, `set( another_instance_of_ajson )`, also typed e.g. `set_date`
1515
- also `setx` for text-based value setting like `setx( '/a/b:123' )` (useful e.g. for constants in APIs or in unit-tests)
1616
- Seralization to string
1717
- Freezing (read only) instance content
18-
- Filtering - create a json skipping empty values, predefined paths, or your custom filter.
18+
- Filtering - create a JSON skipping empty values, predefined paths, or your custom filter.
1919
- Mapping - rule-based changing node names (e.g. snake case to camel case, upper/lower case)
2020
- Iterating (conveniently) through the array items or object members
21-
- Utility to calculate difference between 2 jsons
21+
- Utility to calculate difference between 2 JSONs
2222
- Supports: timestamps
2323
- Supports: data reference initialization
2424

docsite/docs/30-basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ sidebar_position: 30
44

55
# Basics
66

7-
- To **parse** existing json data - call `zcl_ajson=>parse( lv_json_string )`
8-
- To create a new **empty** json instance (to set values and serialize) - call `zcl_ajson=>new( )` or `new zcl_ajson( )` in newer abap syntax
7+
- To **parse** existing JSON data - call `zcl_ajson=>parse( lv_json_string )`
8+
- To create a new **empty** JSON instance (to set values and serialize) - call `zcl_ajson=>new( )` or `new zcl_ajson( )` in newer ABAP syntax
99
- You can **clone** an ajson instance to get a new independent copy with `lo_orig_json->clone( )`
1010

1111
## General rules

docsite/docs/40-reading.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ sidebar_position: 40
44

55
# Reading JSON values
66

7-
The methods of interface allows accessing attributes and converting to abap structure.
8-
9-
Examples below assume original json was:
7+
The methods of interface allows accessing attributes and converting to ABAP structure.
108

9+
Examples below assume original JSON
1110
```json
1211
{
1312
"success": 1,
@@ -64,7 +63,7 @@ data payload type ref to zif_ajson.
6463
payload = r->slice( '/payload' ).
6564
```
6665

67-
Performance tip: note, that slice creates a copy of the json tree, and so increases memory consumtion which may be an issue in some cases.
66+
Performance tip: note, that slice creates a copy of the JSON tree, and so increases memory consumtion which may be an issue in some cases.
6867

6968
## Getting node type
7069

@@ -75,7 +74,7 @@ r->get_node_type( '/payload/false' ). " returns "bool"
7574
r->get_node_type( '/payload/text' ). " returns "str"
7675
```
7776

78-
## Converting to abap structure
77+
## Converting to ABAP structure
7978

8079
```abap
8180
data:

docsite/docs/50-writing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ It is possible to set an instance of ajson immutable (read only). It is done on
267267

268268
## Keep item order
269269

270-
Sometimes you may want to keep order of json items in the same order as it was in abap structure (assuming you `set` structures or table of structures). To do this: set `iv_keep_item_order` flag when creating an instance or call `keep_item_order` after creation of instance, before any `set`.
270+
Sometimes you may want to keep order of JSON items in the same order as it was in ABAP structure (assuming you `set` structures or table of structures). To do this: set `iv_keep_item_order` flag when creating an instance or call `keep_item_order` after creation of instance, before any `set`.
271271

272272
```abap
273273
data:

docsite/docs/60-date-time.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 60
66

77
## Auto format date/time
88

9-
By default date, time and timestamp dates are not formatted and are written in abap format as 'YYYYMMDD', 'HHMMSS'. This can be changed by calling `format_datetime` method after creation. After that the date/time will be auto-formatted as 'YYYY-MM-DD' and 'HH:MM:SS' respectively. **Important: this may become the default behavior in future version**
9+
By default date, time and timestamp dates are not formatted and are written in ABAP format as 'YYYYMMDD', 'HHMMSS'. This can be changed by calling `format_datetime` method after creation. After that the date/time will be auto-formatted as 'YYYY-MM-DD' and 'HH:MM:SS' respectively. **Important: this may become the default behavior in future version**
1010

1111
```abap
1212
data:
@@ -35,12 +35,12 @@ Conversion from JSON to ABAP can determine automatically if the value is a times
3535
- mm = two digits of minute (00 through 59)
3636
- ss = two digits of second (00 through 59)
3737
- TZD = time zone designator (Z or +hh:mm or -hh:mm)
38-
- abap base type of field is P (Packed)
39-
- if the abap field has data element `timestampl`, then fractions of seconds are supported
38+
- ABAP base type of field is P (Packed)
39+
- if the ABAP field has data element `timestampl`, then fractions of seconds are supported
4040

4141
### Examples
4242

43-
Using a json with possible formats:
43+
Using a JSON with possible formats:
4444

4545
```json
4646
{

docsite/docs/70-mapping.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 70
66

77
## How it works
88

9-
You can rename json attribute (node) names with a mapper. Typical example for this is making all attribute names upper/lower case or converting camel-snake naming styles (e.g. `helloWorld -> hello_world`).
9+
You can rename JSON attribute (node) names with a mapper. Typical example for this is making all attribute names upper/lower case or converting camel-snake naming styles (e.g. `helloWorld -> hello_world`).
1010

1111
```abap
1212
lo_orig_json = zcl_ajson=>parse( '{"ab":1,"bc":2}' ).
@@ -26,7 +26,7 @@ Ajson implements a couple of frequent convertors in `zcl_ajson_mapping` class, i
2626
- to camel case (`camelCase`)
2727
- to snake case (`snake_case`)
2828

29-
You can also implement you custom mapper. To do this you have to implement `zif_ajson_mapping->rename_node()`. It accepts the json nodes item-by-item and may change name via `cv_name` parameter. E.g.
29+
You can also implement you custom mapper. To do this you have to implement `zif_ajson_mapping->rename_node()`. It accepts the JSON nodes item-by-item and may change name via `cv_name` parameter. E.g.
3030

3131
```abap
3232
method zif_ajson_mapping~rename_field.
@@ -36,7 +36,7 @@ You can also implement you custom mapper. To do this you have to implement `zif_
3636
endmethod.
3737
```
3838

39-
A realistic use case would be converting an external API result, which are often camel-cased (as this is very common in java-script world), and then converting it into abap structure:
39+
A realistic use case would be converting an external API result, which are often camel-cased (as this is very common in java-script world), and then converting it into ABAP structure:
4040

4141
```abap
4242
data:

docsite/docs/80-filtering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 80
44

55
# Filtering
66

7-
This feature allows creating a json from existing one skipping some nodes. E.g. empty values, predefined paths or using your custom filter.
7+
This feature allows creating a JSON from existing one skipping some nodes. E.g. empty values, predefined paths or using your custom filter.
88

99
## Predefined filters
1010

@@ -58,7 +58,7 @@ This feature allows creating a json from existing one skipping some nodes. E.g.
5858

5959
## Custom filters
6060

61-
In order to apply a custom filter you have to implement a class with `zif_ajson_filter` interface. The interface has one method `keep_node` which receives `is_node` - json tree node of `zif_ajson=>ty_node` type and also the `iv_visit` param. `iv_visit` will be `zif_ajson_filter=>visit_type-value` for all final leafs (str,num,bool,null) and will get `visit_type-open` or `visit_type-close` values for objects and arrays. So the objects and arrays will be called twice - before and after filtering - this allows examining their children number before and after the current filtering. For example of implementation see local implementations of `zcl_ajson_filter_lib` class.
61+
In order to apply a custom filter you have to implement a class with `zif_ajson_filter` interface. The interface has one method `keep_node` which receives `is_node` - JSON tree node of `zif_ajson=>ty_node` type and also the `iv_visit` param. `iv_visit` will be `zif_ajson_filter=>visit_type-value` for all final leafs (str,num,bool,null) and will get `visit_type-open` or `visit_type-close` values for objects and arrays. So the objects and arrays will be called twice - before and after filtering - this allows examining their children number before and after the current filtering. For example of implementation see local implementations of `zcl_ajson_filter_lib` class.
6262

6363
```abap
6464
method zif_ajson_filter~keep_node.

0 commit comments

Comments
 (0)