Skip to content

Commit c3c2495

Browse files
authored
Merge branch 'main' into feature/sxtg
2 parents 484266f + fcc343d commit c3c2495

File tree

137 files changed

+6226
-147551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+6226
-147551
lines changed

compatibility-check/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/json.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ Normally, if an ABAP object is serialized, only the components of the correspond
165165
is added. Note that also the `$required` annotation leads to such behavior.
166166

167167
### Default Values
168-
To set the `default` for a component of the JSON Schema, the annotation
168+
To specify the `default` value for a field of the JSON Schema, the annotation
169169
```abap
170170
"! $default
171171
```
172-
is used, followed by the specification of the default. To provide the default, there are two different possibilities:
173-
1. If the component has enum values, the default value is specified by a link to the corresponding component of the constant describing the enum.
172+
is used, followed by the specification of the default value.
173+
To provide the default, there are two different possibilities:
174+
1. If the field has enum values, the default value is specified by a link to the corresponding component of the constant describing the enum.
174175
```abap
175176
"! $default {@link source_name.data:constant_name.default_component}
176177
```
@@ -179,10 +180,23 @@ To set the `default` for a component of the JSON Schema, the annotation
179180
"! $default 'value'
180181
```
181182
This also ensures that only components whose value is not equal to a specific default value are serialized to the JSON data file.
182-
Fields, which are not specified in the JSON data file, are deserialized to their default values.
183+
184+
Default values can only be specified if one of the following rules apply:
185+
186+
1. The default value represents the initial value of the underlying data type (e.g., `0` for an integer or `space` for a character field).
187+
188+
2. For enumerations, all other values must **not** represent type initial value of the underlying data type.
189+
190+
3. All higher-level structures* of the field are marked as `$required`.
191+
192+
> *) Arrays don't need to be marked as `$required` in this case.
193+
In JSON it is possible to distinguish between empty arrays (`"table": []`) and arrays with "empty" array items (`"table": [{}]`).
194+
All fields with defaults in the array items that don't follow the other rules, along with their higher-level structures, must be marked as `$required`.
195+
196+
Fields that are not specified in the JSON data file are deserialized to their default values.
183197
Note that if you specify a default value, initial values are written to the JSON data file, unless they are not equal to the selected default.
184198

185-
Since fields, which are not specified in the JSON data, might be represented by either initial values or default values, implementations of serialization and deserialization of ABAP file formats must consider fields with default values as specified here.
199+
Since fields that are not specified in the JSON data might be represented by either initial values or default values, implementations of serialization and deserialization of ABAP file formats must consider fields with default values, as specified here.
186200

187201
### Enum Values
188202
To pass enum values to a JSON Schema, a type and a constant are necessary.

file-formats/advc/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# ADVC File Format
1+
# Application Variant File Format
2+
3+
## Object Type Information
4+
5+
Object Type | Description | Group
6+
:--- | :--- | :---
7+
ADVC | Application Variant | LRep
8+
9+
## File Structure
210

311
File | Cardinality | Definition | Schema | Example
412
:--- | :--- | :--- | :--- | :---

file-formats/aifa/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Action File Format
2+
3+
## Object Type Information
4+
5+
Object Type | Description | Group
6+
:--- | :--- | :---
7+
AIFA | Action | Application Interface Framework
8+
9+
## File Structure
10+
11+
File | Cardinality | Definition | Schema | Example
12+
:--- | :--- | :--- | :--- | :---
13+
`<name>.aifa.json` | 1 | [`zif_aff_aifa_v1.intf.abap`](./type/zif_aff_aifa_v1.intf.abap) | [`aifa-v1.json`](./aifa-v1.json)

file-formats/aifa/aifa-v1.json

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
{
2+
"$comment": "This file is autogenerated, do not edit manually, see https://github.com/SAP/abap-file-formats for more information.",
3+
"$schema": "https://json-schema.org/draft/2020-12/schema",
4+
"$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/aifa/aifa-v1.json",
5+
"title": "Action",
6+
"description": "Action",
7+
"type": "object",
8+
"properties": {
9+
"formatVersion": {
10+
"title": "ABAP File Format Version",
11+
"description": "The ABAP file format version",
12+
"type": "string",
13+
"const": "1"
14+
},
15+
"header": {
16+
"title": "Header",
17+
"description": "Header",
18+
"type": "object",
19+
"properties": {
20+
"description": {
21+
"title": "Description",
22+
"description": "Description of the ABAP object",
23+
"type": "string",
24+
"maxLength": 60
25+
},
26+
"originalLanguage": {
27+
"title": "Original Language",
28+
"description": "Original language of the ABAP object",
29+
"type": "string",
30+
"minLength": 2
31+
},
32+
"abapLanguageVersion": {
33+
"title": "ABAP Language Version",
34+
"description": "ABAP language version",
35+
"type": "string",
36+
"enum": [
37+
"standard",
38+
"cloudDevelopment"
39+
],
40+
"enumTitles": [
41+
"Standard",
42+
"ABAP Cloud Development"
43+
],
44+
"enumDescriptions": [
45+
"Standard",
46+
"ABAP cloud development"
47+
],
48+
"default": "standard"
49+
}
50+
},
51+
"additionalProperties": false,
52+
"required": [
53+
"description",
54+
"originalLanguage"
55+
]
56+
},
57+
"generalInformation": {
58+
"title": "General Information",
59+
"description": "General information",
60+
"type": "object",
61+
"properties": {
62+
"namespace": {
63+
"title": "Namespace",
64+
"description": "Namespace",
65+
"type": "string",
66+
"maxLength": 15
67+
},
68+
"aifAction": {
69+
"title": "AIF Action",
70+
"description": "AIF action",
71+
"type": "string",
72+
"maxLength": 20
73+
},
74+
"mainComponentType": {
75+
"title": "Main Component Type",
76+
"description": "Main component type",
77+
"type": "string",
78+
"maxLength": 30
79+
},
80+
"implementingClass": {
81+
"title": "Implementing Class",
82+
"description": "Implementing class",
83+
"type": "string",
84+
"maxLength": 30
85+
}
86+
},
87+
"additionalProperties": false,
88+
"required": [
89+
"namespace",
90+
"aifAction"
91+
]
92+
},
93+
"fieldsToRestore": {
94+
"title": "Fields To Restore",
95+
"description": "Fields to restore",
96+
"type": "array",
97+
"items": {
98+
"title": "Field To Restore",
99+
"description": "Field to restore",
100+
"type": "object",
101+
"properties": {
102+
"name": {
103+
"title": "Name",
104+
"description": "Name",
105+
"type": "string"
106+
}
107+
},
108+
"additionalProperties": false
109+
}
110+
},
111+
"checks": {
112+
"title": "Checks",
113+
"description": "Checks",
114+
"type": "array",
115+
"items": {
116+
"title": "Check Details",
117+
"description": "Check details",
118+
"type": "object",
119+
"properties": {
120+
"id": {
121+
"title": "ID",
122+
"description": "ID",
123+
"type": "string",
124+
"maxLength": 3,
125+
"pattern": "^[0-9]+$"
126+
},
127+
"check": {
128+
"title": "Check",
129+
"description": "Check",
130+
"type": "string",
131+
"maxLength": 30
132+
},
133+
"checkBehaviour": {
134+
"title": "Check Behavior",
135+
"description": "Check behavior",
136+
"type": "string",
137+
"enum": [
138+
"treatAsError",
139+
"ignoreData"
140+
],
141+
"enumTitles": [
142+
"Treat As Error",
143+
"Ignore Data"
144+
],
145+
"enumDescriptions": [
146+
"Treat as error if check is not successful",
147+
"Ignore data if check is not successful"
148+
],
149+
"default": "ignoreData"
150+
},
151+
"fields": {
152+
"title": "Fields",
153+
"description": "Fields",
154+
"type": "array",
155+
"items": {
156+
"title": "Fields To Check",
157+
"description": "Field to check",
158+
"type": "object",
159+
"properties": {
160+
"type": {
161+
"title": "Type",
162+
"description": "Type",
163+
"type": "string",
164+
"enum": [
165+
"sourceStructure",
166+
"destinationStructure",
167+
"constant",
168+
"systemField",
169+
"sendingSystem",
170+
"currentLineNumber",
171+
"hierarchicalMapping"
172+
],
173+
"enumTitles": [
174+
"Source Structure",
175+
"Destination Structure",
176+
"Constant",
177+
"System Field",
178+
"Sending System",
179+
"Current Line Number",
180+
"Hierarchical Mapping"
181+
],
182+
"enumDescriptions": [
183+
"Field is in source structure",
184+
"Field is in desctination structure",
185+
"Field is constant value",
186+
"Field is system field",
187+
"Field is in sending systemte",
188+
"Field is current line number",
189+
"Fieldpath is starting from a parant node"
190+
],
191+
"default": "sourceStructure"
192+
},
193+
"name": {
194+
"title": "Name/Value",
195+
"description": "Name/Value",
196+
"type": "string"
197+
}
198+
},
199+
"additionalProperties": false
200+
}
201+
}
202+
},
203+
"additionalProperties": false,
204+
"required": [
205+
"id",
206+
"check"
207+
]
208+
}
209+
}
210+
},
211+
"additionalProperties": false,
212+
"required": [
213+
"formatVersion",
214+
"header",
215+
"generalInformation"
216+
]
217+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"formatVersion": "1",
3+
"header": {
4+
"description": "Example AIFA for ABAP File Format",
5+
"originalLanguage": "en"
6+
},
7+
"generalInformation": {
8+
"namespace": "ZAIFN",
9+
"aifAction": "CREATE_BUPA",
10+
"mainComponentType": "ZAIF_CREATE_BUPA_STRUCTURE",
11+
"implementingClass": "ZAIF_CL_CREATE_BUPA"
12+
},
13+
"fieldsToRestore": [
14+
{
15+
"name": "BUPA_ID"
16+
}
17+
],
18+
"checks": [
19+
{
20+
"id": "001",
21+
"check": "BUPA_EXIST",
22+
"checkBehaviour": "treatAsError",
23+
"fields": [
24+
{
25+
"type": "sourceStructure",
26+
"name": "BUPA_ID"
27+
},
28+
{
29+
"type": "sourceStructure",
30+
"name": "BUPA_TYPE"
31+
}
32+
]
33+
}
34+
]
35+
}
36+

0 commit comments

Comments
 (0)