PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

ajson

A JSON parser and serialiser for ABAP that parses into a flexible, unstructured node tree rather than a fixed target structure, converting to one only when asked through to_abap.

Deserialising JSON into ABAP normally means fixing a target structure up front; ajson parses into a form that is 'not fixed to any predefined data structure, allowing to modify the parsed data, selectively access its parts and slice subsections of it', and converts to a fixed structure only when asked, through to_abap. That flexibility is useful for slicing off a shared envelope, such as separating a response's top-level fields from its payload for different layers of an application to handle. It also filters a JSON tree to drop empty values or chosen paths, maps node names between casing conventions such as snake_case and camelCase, iterates array items or object members, and diffs two JSON documents. It works from ABAP release 7.02 and installs through abapGit.

Facts

Latestv0.3.5ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
SerialisationABAPSerialisationcapabilityTurning typed in-memory data into a text or binary format such as JSON, CSV or protobuf and reading it back, including the mapping of names and types the language does not do for you. The protocol that carries the payload is a separate concern: an HTTP or OData client moves the bytes, and serialisation decides what they say.
Requires
abapGitabapGitartifactInstalls the class into the system; the README names abapGit as the way in, with no alternative given.

Who is behind it

Alexander TsybulskyAlexander TsybulskyPersonMaintains this
In the atlas: maintains 5, contributes to 11
@sbcgua
maintainerAlbert MinkPersonContributes to this
In the atlas: maintains 1, contributes to 8
@albertmink
Christian GünterPersonContributes to this
In the atlas: maintains 1, contributes to 12
@christianguenter2
Christian WildtPersonContributes to this
In the atlas: contributes to 8
@cwildt
Jaime Rodriguez CapotePersonContributes to this
In the atlas: maintains 1, contributes to 9
@jrodriguez-rc
JXYSGX7CPersonContributes to this
In the atlas: contributes to 2
@JXYSGX7C
Lars HvamPersonContributes to this
In the atlas: maintains 13, contributes to 92, wrote 1
@larshp
Mathieu LawnikPersonContributes to this
In the atlas: contributes to 1
@mathieulawnik
Marc BernardPersonContributes to this
In the atlas: contributes to 26
@mbtools
oblomov-devPersonContributes to this
In the atlas: maintains 4, contributes to 44
@oblomov-dev
PostavkaPersonContributes to this
In the atlas: contributes to 1
@Postavka
12 contributors

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
does not say
Distributed through
abapGit

Connections3

README

quoted from sbcgua/ajson under MIT, read
sbcgua/ajson/README.mdOn GitHub

abaplint abap package version

abap json (ajson)

Yet another JSON parser/serializer for ABAP. It works with release 7.02 or higher.

Recent breaking changes

Since v1.2.0:

  • there are changes in mapper interface, see "Mapping (field renaming)" section in the docs. In essence, implement rename_node method if needed, to_json and to_abap will be deprecated. As well as create_field_mapping and create_camel_case mappers
  • potentially create_empty static method may be deprecated. It is considered to use new instead (and/or direct creation create object). Under consideration, post an issue if you have an opinion on this subject.
  • also create_from is potentially suboptimal, so prefer clone, filter and map instead.

Features

  • parse 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
    • 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)
  • allows conversion to fixed abap structures/tables (to_abap)
  • convenient interface to manipulate the data - set( value ), set( structure ), set( table ), set( another_instance_of_ajson ), also typed e.g. set_date
    • also setx for text-based value setting like setx( '/a/b:123' ) (useful e.g. for constants in APIs or in unit-tests)
  • seralization to string
  • freezing (read only) instance content
  • filtering. Create a JSON skipping empty values, predefined paths, or your custom filter.
  • mapping - rule-based changing node names (e.g. snake case to camel case, upper/lower case)
  • iterating through the array items or object members
  • utility to calculate difference between 2 JSONs

Installed using abapGit, see also Installation section of the documentation.

Example of usage

data r type ref to zif_ajson.
data fragment type ref to zif_ajson.

r = zcl_ajson=>parse( '{"success": 1, "error": "", "payload": {"text": "hello"}}' ).

r->get( '/success' ).              " returns "1"
r->get_integer( '/success' ).      " returns 1 (number)
r->get_boolean( '/success' ).      " returns "X" (abap_true - because not empty)
r->get( '/payload/text' ).         " returns "hello"

r->members( '/' ).                 " returns table of "success", "error", "payload"

fragment = r->slice( '/payload' ).
fragment->get( '/text' ).          " returns "hello" (the root has changed)

fragment->set(
  iv_path = '/text'
  iv_val  = 'new text' ).
fragment->stringify( ).            " {"text":"new text"}

See a lot more examples and usages in the Documentation.

References

MIT, read

History

Latest

v0.3.5

  1. v0.3.4

  2. v0.3.3

  3. v0.3.2

  4. v0.3.0

  5. v0.2.0

  6. v0.1.0

  7. v0.0.2

On npm
1downloads per week, npm
Weekly downloads for ajson26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 1.27 Apr – 3 May: 384 May – 10 May: 2611 May – 17 May: 2718 May – 24 May: 525 May – 31 May: 61 Jun – 7 Jun: 228 Jun – 14 Jun: 4315 Jun – 21 Jun: 422 Jun – 28 Jun: 1129 Jun – 5 Jul: 246 Jul – 12 Jul: 1513 Jul – 19 Jul: 920 Jul – 26 Jul: 1127 Jul – 2 Aug: 83 Aug – 9 Aug: 1910 Aug – 16 Aug: 1817 Aug – 23 Aug: 1624 Aug – 30 Aug: 1731 Aug – 6 Sept: 97 Sept – 13 Sept: 1214 Sept – 20 Sept: 1221 Sept – 27 Sept: 1028 Sept – 4 Oct: 215 Oct – 11 Oct: 412 Oct – 18 Oct: 2419 Oct – 25 Oct: 1
Serialisation
  1. ABAP JSON APIJSON renderer and parser for ABAP with camelCase conversionfrom ABAP
  2. zcl_mdp_jsonABAP library generating and parsing JSON stringsfrom ABAP
  3. JSON2ABAPTypeGenerator of ABAP type definitions from JSON structuresfrom ABAP
  4. abap-protobufProtocol Buffers (proto2) implementation in ABAPfrom ABAP
  5. ZASISRegex RuleSets that read barcode strings into named fieldsfrom ABAP
  6. ABAP ArchitectEclipse plug-in turning JSON or XML into ABAP types and DDIC objectsfrom ABAP
  7. ABAP to JSON serializer and deserializerOpen-source Z* version of /UI2/CL_JSON for ABAP to JSONfrom ABAP
  8. sbcgua/text2tabParser of TAB-delimited text into ABAP internal tables and backfrom ABAP
  9. ABAP JSON Encoder/DecoderJSON encoder and decoder for ABAP, modelled on Go's encoding/jsonfrom ABAP
  10. ZwdCSVRFC 4180 CSV parser and generator for ABAPfrom ABAP
  11. ABAP CSV ManagerConfigurable CSV reader and writer for ABAPfrom ABAP

Details

Sources3
Added by handdiscovered herechecked
github.com/git+https://github.com/tim-kos/ajson.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
latestv0.3.5
first release
releases and cadence8, ~0d median
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainabap, protocols-and-apis
abaplint
issues under its own abaplint configuration0
lines13,415
statements7,282
objects14
files37
analysed, master
abaplint version2.120.84
Contributors12
History in the atlas1
  1. First seen.
For your agent