abap-file-formats icon indicating copy to clipboard operation
abap-file-formats copied to clipboard

JSON file format, define how serialization should work

Open larshp opened this issue 4 years ago • 5 comments

suggest:

  • add comment regarding the schema version
  • add comment regarding use of lowerCamelCase(?) for naming of JSON fields

larshp avatar Apr 12 '21 11:04 larshp

~max field name length = 30 characters, upper case characters counting as 2 characters~

update: not relevant anymore due to the ABAP approach

larshp avatar Apr 13 '21 04:04 larshp

plus compression/initial value handling

larshp avatar May 11 '21 06:05 larshp

plus compression/initial value handling

I am not sure, whether this make sense in all places. Consider such a boolean value for instance to specify whether a BAdI can be implemented by multiple BAdI implementations or only by one: https://github.com/SAP/abap-file-formats/blob/05ef0284856122e796eda519b5116ac63e3f98f5/file-formats/enhs/examples/z_aff_example_enhs.enhs.json#L17

schneidermic0 avatar May 12 '21 09:05 schneidermic0

having one convention/rule makes it transparent, no special cases

if initial values are skipped in the json, then it might have impact on the type design, so instead of

TYPES multiple_use type abap_bool.

then

TYPES: BEGIN OF ENUM use,
  single   VALUE 'single',
  multiple VALUE 'multiple',
END OF ENUM use

is an option to always have the value in the json, note how this makes it part of the type design, and not a special case in json handling

larshp avatar May 12 '21 09:05 larshp

Initial values are not rendered (only if the field is explicitly annotated by $required or $showAlways) see following sections in the specification document:

  • https://github.com/SAP/abap-file-formats/blob/main/doc/specification.md#required-fields
  • https://github.com/SAP/abap-file-formats/blob/main/doc/specification.md#always-shown-fields

When #173 is merged, I think only the schema version question is open.

schneidermic0 avatar Aug 16 '21 13:08 schneidermic0