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

[SIAD]Add file format #572

Merged
merged 4 commits into from
Dec 6, 2023
Merged
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/siad/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SIAD File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.siad.json` | 1 | [`zif_aff_siad_v1.intf.abap`](./type/zif_aff_siad_v1.intf.abap) | [`siad-v1.json`](./siad-v1.json) | [z_aff_siad_example.siad.json](./examples/z_aff_siad_example.siad.json)
11 changes: 11 additions & 0 deletions file-formats/siad/examples/z_aff_siad_example.siad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"formatVersion": "1",
"header": {
"description": "SIAD Example",
"originalLanguage": "en"
},
"assignment": {
"businessroletemplateid": "BRT",
"launchpadspacetemplateid": "LPS"
}
}
90 changes: 90 additions & 0 deletions file-formats/siad/siad-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"$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/siad/siad-v1.json",
"title": "Business Role Template Launchpad Space Template Assignment",
"description": "Business Role Template Launchpad Space Template Assignment",
"type": "object",
"properties": {
"formatVersion": {
"title": "Format Version",
"description": "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,
"maxLength": 2,
"pattern": "^[a-z]+$"
},
"abapLanguageVersion": {
"title": "ABAP Language Version",
"description": "ABAP language version",
"type": "string",
"enum": [
"standard",
"cloudDevelopment"
],
"enumTitles": [
"Standard",
"ABAP Cloud Development"
],
"enumDescriptions": [
"Standard",
"ABAP cloud development"
],
"default": "standard"
}
},
"additionalProperties": false,
"required": [
"description",
"originalLanguage"
]
},
"assignment": {
"title": "General",
"description": "General",
"type": "object",
"properties": {
"businessroletemplateid": {
"title": "Business Role Template ID",
"description": "Business Role Template ID",
"type": "string",
"maxLength": 30
},
"launchpadspacetemplateid": {
"title": "Launchpad Space Template ID",
"description": "Launchpad Space Template ID",
"type": "string",
"maxLength": 35
}
},
"additionalProperties": false,
"required": [
"businessroletemplateid",
"launchpadspacetemplateid"
]
}
},
"additionalProperties": false,
"required": [
"formatVersion",
"header",
"assignment"
]
}
43 changes: 43 additions & 0 deletions file-formats/siad/type/zif_aff_siad_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
INTERFACE zif_aff_siad_v1
PUBLIC.

TYPES:

"! <p class="shorttext">Assignment</p>
"! Assignment
BEGIN OF ty_assignment,

Check failure on line 8 in file-formats/siad/type/zif_aff_siad_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Type "TY_ASSIGNMENT" contains unknown: APS_IAM_BRT_ID not found, lookup

https://rules.abaplint.org/unknown_types

"! <p class="shorttext">Business Role Template ID</p>
albertmink marked this conversation as resolved.
Show resolved Hide resolved
"! Business Role Template ID
albertmink marked this conversation as resolved.
Show resolved Hide resolved
"! $required
BusinessRoleTemplateID TYPE aps_iam_brt_id,

Check failure on line 13 in file-formats/siad/type/zif_aff_siad_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Identifiers should be lower case: "BusinessRoleTemplateID"

https://rules.abaplint.org/keyword_case
Copy link
Contributor

Choose a reason for hiding this comment

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

we prefer primitive data types (towards self contained, assuming basic types as char are known), so aps_iam_brt_id is a char[30] right?

Copy link
Contributor

Choose a reason for hiding this comment

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

same for /UI2/SPACE_ENTITY_ID

Copy link
Contributor

Choose a reason for hiding this comment

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

I even guess you want to use underscores this will transform it to camel case in the JSON schema. Therefore, I suggest to use business_role_template_id or even business_role_template.

Since it is an object name with the length of 30 characters, you might want to reuse zif_aff_types_v1=>ty_object_name_30

Suggested change
BusinessRoleTemplateID TYPE aps_iam_brt_id,
business_role_template_id TYPE zif_aff_types_v1=>ty_object_name_30,


"! <p class="shorttext">Launchpad Space Template ID</p>
albertmink marked this conversation as resolved.
Show resolved Hide resolved
"! Launchpad Space Template ID
albertmink marked this conversation as resolved.
Show resolved Hide resolved
"! $required
LaunchpadSpaceTemplateID TYPE /ui2/space_entity_id,

Check failure on line 18 in file-formats/siad/type/zif_aff_siad_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Identifiers should be lower case: "LaunchpadSpaceTemplateID"

https://rules.abaplint.org/keyword_case
albertmink marked this conversation as resolved.
Show resolved Hide resolved

END OF ty_assignment,

"! <p class="shorttext">Business Role Template Launchpad Space Template Assignment</p>
"! Business Role Template Launchpad Space Template Assignment
BEGIN OF ty_main,

Check failure on line 24 in file-formats/siad/type/zif_aff_siad_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Type "TY_MAIN" contains unknown: APS_IAM_BRT_ID not found, lookup

https://rules.abaplint.org/unknown_types

"! <p class="shorttext">Format Version</p>
"! Format version
"! $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_cloud,

"! <p class="shorttext">General</p>
"! General
"! $required
assignment TYPE ty_assignment,
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you want to emphasise. Do developers specify "general information" or the "assignments" of the object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We compared our editor with other editors of us and we always have this "General" at top in other editors.
But you are right developers specify more the "assignments" of the object, so "Assignment" would be better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, "General Information" is used, if we are not able to find a better semantic name. If there is a more specific name, we suggest to use this one. See second-last paragraph of https://github.com/SAP/abap-file-formats/blob/main/docs/json.md#writing-json-schema-with-abap-types

I am not sure, maybe, it's even "Assignements" because there are multiple assignments (to the business role template and to the space template)? It's not an assignment between business role template and space template, is it? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think general information would be the best choice, the whole object is an assignment of a business role template and a space template, so if it would be "Assignment(s)" this would be a duplicate and makes not that much sense in this position.


END OF ty_main.

ENDINTERFACE.
7 changes: 7 additions & 0 deletions file-formats/siad/type/zif_aff_siad_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "AFF for type SIAD - V1",
"originalLanguage": "en"
}
}
Loading