Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new object type DRAS (abapGit#6950) #622

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions file-formats/dras/README.md
fvalves marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DRAS File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.dras.json` | 1 | [`zif_aff_dras_v1.intf.abap`](./type/zif_aff_dras_v1.intf.abap) | [`dras-v1.json`](./dras-v1.json) | [`z_aff_example_dras.dras.json`](./examples/z_aff_example_dras.dras.json)
66 changes: 66 additions & 0 deletions file-formats/dras/dras-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"$comment": "This file is autogenerated, do not edit manually, see https://github.com/SAP/abap-file-formats for more information.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/dras/dras-v1.json",
"title": "CDS Aspect",
"description": "CDS scalar aspect",
"type": "object",
"properties": {
"formatVersion": {
"title": "ABAP File Format Version",
"description": "The ABAP file format version",
"type": "string",
"const": "1"
},
"header": {
"title": "Header",
"description": "Header",
"type": "object",
"properties": {
"description": {
"title": "Description",
"description": "Description of the ABAP object",
"type": "string",
"maxLength": 60
},
"originalLanguage": {
"title": "Original Language",
"description": "Original language of the ABAP object",
"type": "string",
"minLength": 2
},
"abapLanguageVersion": {
"title": "ABAP Language Version",
"description": "ABAP language version",
"type": "string",
"enum": [
"standard",
"keyUser",
"cloudDevelopment"
],
"enumTitles": [
"Standard",
"ABAP for Key Users",
"ABAP Cloud Development"
],
"enumDescriptions": [
"Standard",
"ABAP for key user extensibility",
"ABAP cloud development"
],
"default": "standard"
}
},
"additionalProperties": false,
"required": [
"description",
"originalLanguage"
]
}
},
"additionalProperties": false,
"required": [
"formatVersion",
"header"
]
}
5 changes: 5 additions & 0 deletions file-formats/dras/examples/z_aff_example_dras.dras.acds
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@EndUserText.label: 'Example CDS Aspect'
define aspect Z_AFF_EXAMPLE_DRAS {
example_bound_field : abap.int2;
example_calculated_field = ( example_bound_field + 3 ) * 2;
}
8 changes: 8 additions & 0 deletions file-formats/dras/examples/z_aff_example_dras.dras.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"formatVersion": "1",
"header": {
"description": "Example CDS Aspect",
"originalLanguage": "en",
"abapLanguageVersion": "standard"
fvalves marked this conversation as resolved.
Show resolved Hide resolved
}
}
16 changes: 16 additions & 0 deletions file-formats/dras/type/zif_aff_dras_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
INTERFACE zif_aff_dras_v1
PUBLIC.

TYPES:
"! <p class="shorttext">CDS Aspect</p>
"! CDS scalar aspect
BEGIN OF ty_main,
"! $required
format_version TYPE zif_aff_types_v1=>ty_format_version,
"! <p class="shorttext">Header</p>
"! Header
"! $required
header TYPE zif_aff_types_v1=>ty_header_60,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a short question? Is key-user-tooling supported for DRAS?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, If you do not use key-user tooling I suggest to use ty_header_60_cloud which only supports "standard" and "cloudDevelopmnet"

Suggested change
header TYPE zif_aff_types_v1=>ty_header_60,
header TYPE zif_aff_types_v1=>ty_header_60_cloud,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be supported in the future, though. Is it preferable to have it already prepared or should it be restricted now and changed back to ty_header_60 later?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to change it and change it back to ty_header_60 as soon as it is supported. As far as I can see this change should be compatible (in the future)

END OF ty_main.

ENDINTERFACE.
7 changes: 7 additions & 0 deletions file-formats/dras/type/zif_aff_dras_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "AFF type for DRAS objects (CDS aspects)",
"originalLanguage": "en"
}
}
Loading