Skip to content

Commit 83ba32f

Browse files
authored
Merge branch 'main' into feature/edot
2 parents 4c90f28 + 5eedc30 commit 83ba32f

File tree

130 files changed

+5444
-147559
lines changed

Some content is hidden

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

130 files changed

+5444
-147559
lines changed

.github/workflows/example-not-delted.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- name: Get deleted files
2121
id: changed-files
22-
uses: tj-actions/changed-files@v44
22+
uses: step-security/changed-files@v45.0.1
2323
with:
2424
files: "file-formats/*/examples/*"
2525

.reuse/dep5

Lines changed: 0 additions & 8 deletions
This file was deleted.

REUSE.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version = 1
2+
SPDX-PackageName = "ABAP file formats"
3+
SPDX-PackageSupplier = "ABAP file formats team <[email protected]>"
4+
SPDX-PackageDownloadLocation = "https://github.com/SAP/abap-file-formats"
5+
6+
[[annotations]]
7+
path = "**"
8+
precedence = "aggregate"
9+
SPDX-FileCopyrightText = "2021 SAP SE or an SAP affiliate company and ABAP file formats contributors"
10+
SPDX-License-Identifier = "MIT"

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/aifd/README.md

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

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

file-formats/aiff/README.md

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

file-formats/aiff/aiff-v1.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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/aiff/aiff-v1.json",
5+
"title": "Fix Value",
6+
"description": "Fix value",
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+
"aifFixValue": {
69+
"title": "AIF Fix Value",
70+
"description": "AIF fix value",
71+
"type": "string",
72+
"maxLength": 20
73+
},
74+
"fieldValue": {
75+
"title": "Field Value",
76+
"description": "Field value",
77+
"type": "string",
78+
"maxLength": 255
79+
}
80+
},
81+
"additionalProperties": false,
82+
"required": [
83+
"namespace",
84+
"aifFixValue"
85+
]
86+
}
87+
},
88+
"additionalProperties": false,
89+
"required": [
90+
"formatVersion",
91+
"header",
92+
"generalInformation"
93+
]
94+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"formatVersion": "1",
3+
"header": {
4+
"description": "Example AIFF for ABAP File Format",
5+
"originalLanguage": "en",
6+
"abapLanguageVersion": "cloudDevelopment"
7+
},
8+
"generalInformation":{
9+
"namespace": "AIFNS",
10+
"aifFixValue": "FixValue1",
11+
"fieldValue": "1"
12+
}
13+
}

0 commit comments

Comments
 (0)