Skip to content

Commit

Permalink
Merge branch 'main' into feature/gsmg
Browse files Browse the repository at this point in the history
  • Loading branch information
albertmink authored Oct 4, 2024
2 parents 4b3fdc5 + 0f49654 commit a3a5de8
Show file tree
Hide file tree
Showing 33 changed files with 484 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
root = true

# ensure the LF line endings
[*.{abap,md,properties,acds,json,mjs,gitignore}]
[*.{abap,md,properties,acds,json,mjs,gitignore,yml}]
charset = utf-8
end_of_line = lf
insert_final_newline = true
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/example-not-delted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Don't delete examples

on:
pull_request:

permissions:
contents: read

jobs:
build:
# Name the Job
name: Don't delete examples

runs-on: ubuntu-latest

timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- name: Get deleted files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: "file-formats/*/examples/*"

- name: List all deleted files
env:
ALL_DELETED_FILES: ${{ steps.changed-files.outputs.deleted_files }}
run: |
for file in ${ALL_DELETED_FILES}; do
echo "::error $file has been deleted"
exit 1
done
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Compatability Check
name: Compatibility Check

on:
pull_request:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on:

permissions:
contents: read
pull-requests: write

jobs:
check-links:
name: Check links
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@main
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
base-branch: 'main'
- uses: actions/checkout@v4
- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
reporter: github-pr-review
fail_on_error: true
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ Summarize the issue well. Here are some guidelines:
Feedback, especially bug reports, is always welcome. However, our capacity as a team is limited -- we cannot answer specific project or consultation requests, nor can we invest time in fleshing out what might be a bug. Because of this, we reserve the right to close or not process issue reports that do not contain enough information. We also do not guarantee that every well-documented issue will be fixed.

## Contributing Code
We welcome contributions to our codebase. Before you start your first contribution, here are some things you should know:
We welcome contributions to our codebase.

Create [pull requests](https://github.com/SAP/abap-file-formats/compare)
if you know exactly what you want to change, and how.
They are most welcome, and may range
from minor format corrections to adding whole sections.
Before you start your first contribution, please refer to [the contribution guidelines for SAP open source projects](https://github.com/SAP/.github/blob/main/CONTRIBUTING.md).

## Developer Certificate of Origin (DCO)
Due to legal reasons, contributors will be asked to accept a DCO before they submit the first pull request to this projects, this happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Comments and suggestions for improvements are most welcome.

Do you feel responsible for an ABAP object type?
We will be more than happy if you contribute your object type to this project.
Just open a new pull request and create an ABAP type like it is specified [here](./docs/json.md#writing-JSON-schema-with-ABAP-types).
Just open a new pull request and create an ABAP type like it is specified [here](./docs/json.md#writing-json-schema-with-abap-types).
Feel free to hand over the type to us, so we can generate the JSON Schema for you.

More details are found in [Contributing](./CONTRIBUTING.md).
Expand Down
2 changes: 1 addition & 1 deletion abaplint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"unsecure_fae": true,
"unused_methods": true,
"unused_types": {
"skipNames": ["ty_main"]
"skipNames": ["ty_main","ty_header_80"]
},
"unused_variables": true,
"use_bool_expression": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/decision-log/0001-json-version.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# JSON Versioning

* Status: [accepted] <!-- optional -->
* Deciders: [https://github.com/orgs/SAP/teams/abap-file-formats-team] <!-- optional -->
* Deciders: [[https://github.com/orgs/SAP/teams/abap-file-formats-team]](https://github.com/orgs/SAP/teams/abap-file-formats-team) <!-- optional -->
* Date: [2021-09] <!-- optional -->

Technical Story:
Expand Down
9 changes: 6 additions & 3 deletions docs/json.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## JSON Files in ABAP File Formats
JSON files are central since every ABAP object specifies at least a JSON file.
Depending on the object, there might be additional files containing source code or other information, but there is always a JSON file with the pattern `<object_name>.<object_type>.json`, see [`File Names`](./specification.md#File-Names).
Depending on the object, there might be additional files containing source code or other information, but there is always a JSON file with the pattern `<object_name>.<object_type>.json`, see [`File Names`](./specification.md#file-names).
For its annotation and validation, the ABAP file formats provide JSON Schemas.

## Table of Contents
* [Format Versions and Compatibility](#format-versions-and-compatibility)
* [Writing JSON Schema with ABAP Types](#writing-JSON-schema-with-ABAP-types)
* [Writing JSON Schema with ABAP Types](#writing-json-schema-with-abap-types)
* [Example](#example)
* [Reusable Fields in JSON Files](#reusable-fields-in-json-files)

Expand Down Expand Up @@ -135,7 +135,7 @@ followed by a space and the desired value are used.
In order to express constraints to the values of a field, it is possible to pass regular expressions enclosed in single quotes:

```abap
"! $pattern '<regex pattern, i.e. [a-Z]*>'
"! $pattern '<regex pattern, i.e. [a-z]*>'
```
The complete syntax of regular expressions is not widely supported, therefore it is recommended to stick on the subset described [here](https://json-schema.org/understanding-json-schema/reference/regular_expressions).

Expand All @@ -154,6 +154,9 @@ If a field is to be declared as "required" in the JSON Schema, the annotation
```
is used.

Please note, we do not recommend using the `$required` annotation for boolean fields, as omitting such a field in the JSON file is equivalent to setting its value to `false`.
If the field is crucial to be serialized (even if the value is `false`), you can use the annotation `$showAlways`.

### Always Shown Fields
Normally, if an ABAP object is serialized, only the components of the corresponding type with a non-initial value are written to the JSON data file. If a component shall be shown regardless to its value, the annotation
```abap
Expand Down
11 changes: 7 additions & 4 deletions docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
---

## Table of Contents
* [File Names](#File-Names)
* [File Extensions](#File-Extensions)
* [Formatting Conventions](#Formatting-Conventions)
* [File Names](#file-names)
* [File Extensions](#file-extensions)
* [Formatting Conventions](#formatting-conventions)

## File Names

Expand Down Expand Up @@ -47,18 +47,21 @@ cl_oo_clif_source.clas.texts.en.properties
The language of the texts is encoded by the element `language` following [BCP47](https://en.wikipedia.org/wiki/IETF_language_tag).
```
cl_oo_clif_source.clas.texts.en.properties
cl_oo_clif_source.clas.texts.en-GB.properties
```
For the text elements of classes, this language will be the original language (provided by the metadata file).


## File Extensions

ABAP file formats define the file types:
ABAP file formats use the file types:
* **`.abap`** stores ABAP source code as plain text
* **`.acds`** stores source code of ABAP Core Data Services (CDS) as plain text
* **`.json`** stores content of form-based editors or properties of objects, such as `originalLanguage`, `abapLanguageVersion` and others.
Details are found in [JSON Files in ABAP File Formats](./json.md)
* **`.properties`** stores text elements as plain text and [translation texts](properties.md)
* **`.xdp`** stands for XML Data Packaging and is part of Form Objects (SFPF)
* **`.csn`** is a notation for compact representations of CDS models and is part of CSN Models (CSNM)


## Formatting Conventions
Expand Down
8 changes: 4 additions & 4 deletions file-formats/aifr/aifr-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@
"description": "Recipient details",
"type": "object",
"properties": {
"namespaceObjectName": {
"title": "Namespace Object Name",
"description": "Namespace object name of the recipient",
"namespace": {
"title": "Namespace",
"description": "Namespace of the recipient",
"type": "string",
"maxLength": 15
}
},
"additionalProperties": false,
"required": [
"namespaceObjectName"
"namespace"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion file-formats/aifr/examples/z_aff_example_aifr.aifr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"abapLanguageVersion": "cloudDevelopment"
},
"recipientDetails":{
"namespaceObjectName": "AIFNS"
"namespace": "AIFNS"
}
}
6 changes: 3 additions & 3 deletions file-formats/aifr/type/zif_aff_aifr_v1.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ INTERFACE zif_aff_aifr_v1
"! <p class="shorttext">Recipient Details</p>
"! Recipient details
BEGIN OF ty_recipient_details,
"! <p class="shorttext">Namespace Object Name</p>
"! Namespace object name of the recipient
"! <p class="shorttext">Namespace</p>
"! Namespace of the recipient
"! $required
namespace_object_name TYPE c LENGTH 15,
namespace TYPE c LENGTH 15,
END OF ty_recipient_details,

"! <p class="shorttext">Recipient</p>
Expand Down
15 changes: 8 additions & 7 deletions file-formats/dcat/dcat-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,18 @@
"description": "Sensitivity level for data category",
"type": "string",
"enum": [
"sensitivePersonalData",
"personalData"
"personalData",
"sensitivePersonalData"
],
"enumTitles": [
"Sensitive Personal Data",
"Personal Data"
"Personal Data",
"Sensitive Personal Data"
],
"enumDescriptions": [
"Sensitive personal data",
"Personal data"
]
"Personal data",
"Sensitive personal data"
],
"default": "personalData"
}
},
"additionalProperties": false
Expand Down
10 changes: 6 additions & 4 deletions file-formats/dcat/type/zif_aff_dcat_v1.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ INTERFACE zif_aff_dcat_v1
"! <p class="shorttext">Sensitivity Level</p>
"! Data category sensitivity level
BEGIN OF co_categ_senst_lvl,
"! <p class="shorttext">Sensitive Personal Data</p>
"! Sensitive personal data
sensitive_personal_data TYPE c LENGTH 1 VALUE 'S',
"! <p class="shorttext">Personal Data</p>
"! Personal data
personal_data TYPE c LENGTH 1 VALUE '',
"! <p class="shorttext">Sensitive Personal Data</p>
"! Sensitive personal data
sensitive_personal_data TYPE c LENGTH 1 VALUE 'S',
END OF co_categ_senst_lvl.

TYPES:
Expand All @@ -19,7 +19,8 @@ INTERFACE zif_aff_dcat_v1
BEGIN OF ty_attributes,
"! <p class="shorttext">Sensitivity Level</p>
"! Sensitivity level for data category
"! $values {@link zif_aff_dcat_v1.data:co_categ_senst_lvl}
"! $values { @link zif_aff_dcat_v1.data:co_categ_senst_lvl }
"! $default { @link zif_aff_dcat_v1.data:co_categ_senst_lvl.personal_data }
sensitivity_level TYPE c LENGTH 1,
END OF ty_attributes.

Expand All @@ -41,4 +42,5 @@ INTERFACE zif_aff_dcat_v1
attributes TYPE ty_attributes,
END OF ty_main.


ENDINTERFACE.
7 changes: 3 additions & 4 deletions file-formats/dsfi/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# DSFI File Format


File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.dsfi.json` | 1 | [`zif_aff_dsfi_v1.intf.abap`](./type/zif_aff_dsfi_v1.intf.abap) | [`dsfi-v1.json`](./dsfi-v1.json) | [`z_aff_example_dsfi_ana.dsfi.json`](./examples/z_aff_example_dsfi_ana.dsfi.json)
File | Cardinality | Definition | Schema | Examples
:--- | :--- | :--- | :--- | :---
`<name>.dsfi.json` | 1 | [`zif_aff_dsfi_v1.intf.abap`](./type/zif_aff_dsfi_v1.intf.abap) | [`dsfi-v1.json`](./dsfi-v1.json) | [`z_aff_example_dsfi_ana.dsfi.json`](./examples/z_aff_example_dsfi_ana.dsfi.json) (Analytical engine) <br/>[`z_aff_example_dsfi_sql.dsfi.json`](./examples/z_aff_example_dsfi_sql.dsfi.json) (SQL engine)
34 changes: 30 additions & 4 deletions file-formats/dsfi/dsfi-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"const": "1"
},
"header": {
"title": "Header for Source Code Objects",
"title": "Header",
"description": "The header for an ABAP main object (with source code) with a description of 60 characters",
"type": "object",
"properties": {
Expand Down Expand Up @@ -67,13 +67,39 @@
"description": "Engine",
"type": "string",
"enum": [
"analyticalEngine"
"analyticalEngine",
"sqlEngine"
],
"enumTitles": [
"Analytical Engine"
"Analytical Engine",
"SQL Engine"
],
"enumDescriptions": [
"Analytical engine"
"Analytical engine",
"SQL engine"
],
"default": "analyticalEngine"
},
"sqlProperties": {
"title": "SQL Properties",
"description": "SQL Properties",
"type": "object",
"properties": {
"amdpReference": {
"title": "AMDP Reference",
"description": "The name of the AMDP implementation reference",
"type": "string",
"maxLength": 100
},
"autoExposedInSqlServices": {
"title": "Automatically Exposed in SQL Services",
"description": "Flag whether or not the SQL implementation of the CDS scalar function will be automatically exposed in all SQL services",
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"amdpReference"
]
}
},
Expand Down
13 changes: 13 additions & 0 deletions file-formats/dsfi/examples/z_aff_example_dsfi_sql.dsfi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"formatVersion": "1",
"header": {
"description": "Example CDS scalar function",
"originalLanguage": "en"
},
"scalarFunctionName": "Z_AFF_EXAMPLE_DSFI",
"engine": "sqlEngine",
"sqlProperties": {
"amdpReference": "ZCL_DSFI_EXAMPLE=>EXECUTE",
"autoExposedInSqlServices": true
}
}
Loading

0 comments on commit a3a5de8

Please sign in to comment.