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

[SITO] File format for situation objects #364

Closed
wants to merge 3 commits into from

Conversation

tobiasmuenchsap
Copy link

Initial pre-review version of SITO AFF

Please get in contact with us for review appointment

Initial pre-review version of SITO AFF
@cla-assistant
Copy link

cla-assistant bot commented May 12, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ tobiasmuench
❌ tobiasmuenchsap
You have signed the CLA already but the status is still pending? Let us recheck it.

"type": "string",
"maxLength": 32
},
"abapLanguageVersion": {
Copy link
Contributor

Choose a reason for hiding this comment

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

The abap_lanuage_version is saved in the header-part. No need to save it here

"title": "Object Extensible",
"description": "Extensibility Flag for Situation Objects",
"type": "string",
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks to me that for this field "type": "boolean" is sufficient. You should only use an enum if you think that in future some more values will be available.

Copy link
Contributor

Choose a reason for hiding this comment

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

In our interface, a boolean representation is CHAR(1) - as usual in ABAP.

How can we avoid that it is transformed to string instead of boolean?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can just use abap_bool as type. This will be transferred to boolean in the JSON schema.

Here you can see an example:

fix_point_arithmetic TYPE abap_bool,

We should update the documentation. I have created an issue see #365

"sitnobjisreusable": {
"title": "Object Reusable",
"description": "Reusability Flag",
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think "type": "boolean" is sufficient here

"sitnobjstrucisreusable": {
"title": "Object Reusable",
"description": "Reusability Flag",
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

is "type": "boolean" sufficient?

"properties": {
"sitnobjstrucdesc": {
"title": "Situation Object Structure Description",
"description": "Situation Object Structure Description",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please write the description in sentence case. This means to write the description as if it was a normal english sentence. Example: "The quick brown fox jumps over the lazy dog"

Copy link
Contributor

Choose a reason for hiding this comment

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

We extract these texts from our Data Elements Domains. Our UA experts want them to be camel case. Would it be really required to parse and change the texts for the json serialization?

Copy link
Contributor

Choose a reason for hiding this comment

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

In general, titles shall be title style, descriptions shall be sentence style

However, for names like here, we usually stick to the definition in SAP term. I guess your UAs know whether they are written upper case. ;)
So in your case it might be a description like "The quick brown fox jumps over the Situation Object Structure Description" because "Situation Object Structure Description" is defined in SAP term this way.

We typically struggle, because object types like "class", "tables", and so on are defined as lower case in SAP term.

"sitnobjevtisreusable": {
"title": "Object Reusable",
"description": "Reusability Flag",
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

is "type": "boolean" sufficient?

"title": "Object Reusable",
"description": "Reusability Flag",
"type": "string",
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

is "type": "boolean" sufficient?

"title": "Object Reusable",
"description": "Reusability Flag",
"type": "string",
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

is "type": "boolean" sufficient?

"description": "Reusability Flag",
"type": "string",
"enum": [
"yes",
Copy link
Contributor

Choose a reason for hiding this comment

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

is "type": "boolean" sufficient?

"sitnobjvhsrvcisreusable": {
"title": "Object Reusable",
"description": "Reusability Flag",
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

is "type": "boolean" sufficient?

@schneidermic0 schneidermic0 marked this pull request as draft May 13, 2022 07:27
@schneidermic0 schneidermic0 self-requested a review May 13, 2022 07:30
Copy link
Contributor

@schneidermic0 schneidermic0 left a comment

Choose a reason for hiding this comment

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

@tobiasmuenchsap Thank you for your contribution.

Before I go through details, I would like you to ask to change following in this pull request:

  1. Would you also upload your interface (starting with Z) and (if possible) an example object. In SAP-internal systems, there is currently still a program you can use for this step to generate the whole folder as described in our how-to. This would also help that we can do the most part of the review in the ABAP interface itself.
  2. I suggest to go over the field names (see one example in my comments) to get human-readable names. I would use underscores to split the name and also remove the IMHO unnecessary prefixes like sitnobj.

"description": "SIT2_OBJ_STR_SK",
"type": "object",
"properties": {
"sitnobjectfieldorder": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just one example, how I would rename the fields. In the ABAP interface it would be renamed to field_order instead of sitnobjectfieldorder:

Suggested change
"sitnobjectfieldorder": {
"fieldOrder": {


"! <p class="shorttext">List of SIT2_OBJ_STRUC_T</p>
"! List of SIT2_OBJ_STRUC_T
ty_sit2_obj_struc_t_list TYPE STANDARD TABLE OF ty_sit2_obj_struc_t WITH EMPTY KEY,
Copy link
Contributor

Choose a reason for hiding this comment

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

Downport EMPTY KEY

Suggest following fix,

Suggested change
ty_sit2_obj_struc_t_list TYPE STANDARD TABLE OF ty_sit2_obj_struc_t WITH EMPTY KEY,
ty_sit2_obj_struc_t_list TYPE STANDARD TABLE OF ty_sit2_obj_struc_t WITH DEFAULT KEY,

Copy link
Contributor

@schneidermic0 schneidermic0 left a comment

Choose a reason for hiding this comment

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

Thanks for the update. The example and the ABAP type are helpful.
I have added a bunch of comments (see below).

However, here are some general remarks:

  • As mentioned before, I think the fields need to be renamed. It is really hard to understand which information needs to be specified and will be hard for users to understand the content of the JSON.
  • It would be helpful at a lot of places to use enum values instead of native values like "01" or "CB" (see https://github.com/SAP/abap-file-formats/blob/main/docs/json.md#enum-values)
  • Would you please fix the errors raised by abaplint?
  • I guess we can remove the translations since we want to specify descriptions only in the originalLanguage. As of now, translations shall be handled in dedicated files (tbd; see Handling translations #106).

@@ -0,0 +1,349 @@
INTERFACE if_aff_sito_v1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
INTERFACE if_aff_sito_v1
INTERFACE zif_aff_sito_v1

@@ -0,0 +1,349 @@
INTERFACE if_aff_sito_v1
PUBLIC .
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
PUBLIC .
PUBLIC.

"! SIT2_OBJECT
BEGIN OF ty_sit2_object,
"! <p class="shorttext">Situation Object ID</p>
sitnobjectid TYPE sit2_de_object_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the object name? If so, we typically don't add them to the file formats. The object name is specified by the filename.

Comment on lines +306 to +307
"! <p class="shorttext">ABAP Language Version</p>
abap_language_version TYPE abap_language_version,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need the ABAP language version twice. It is already stored in the header...

"! <p class="shorttext">ABAP Language Version</p>
abap_language_version TYPE abap_language_version,
"! <p class="shorttext">Object Extensible</p>
sitnobjisextensible TYPE sit2_de_extensible,
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned before, I suggest to rename the fields. E.g. something like extensible?

Suggested change
sitnobjisextensible TYPE sit2_de_extensible,
extensible TYPE sit2_de_extensible,

Furthermore, it would be great if the types in this interface would be self-contained.

Comment on lines +153 to +154
"sitnobjeventcategory": "CL",
"sitnobjevtscope": "01",
Copy link
Contributor

Choose a reason for hiding this comment

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

Enums?

Comment on lines +226 to +227
"sitnactiontype": "02",
"sitnobjactscope": "01",
Copy link
Contributor

Choose a reason for hiding this comment

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

Enums?

Comment on lines +229 to +240
"sit2ObjActT": [
{
"language": "en",
"sitnactionname": "Upgrade Passengers",
"sitnactiondescription": "Upgrade economy passengers to business class"
},
{
"language": "de",
"sitnactionname": "Passagiere upgraden",
"sitnactiondescription": "Economy-Passagiere auf Business Class upgraden"
}
],
Copy link
Contributor

Choose a reason for hiding this comment

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

Translations?

Comment on lines +338 to +344
"sit2ObjCbPar": [
{
"sitncallbackparamname": "BOOKID"
},
{
"sitncallbackparamname": "CARRID"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

If you rename the fields you can even think of something like this:

Suggested change
"sit2ObjCbPar": [
{
"sitncallbackparamname": "BOOKID"
},
{
"sitncallbackparamname": "CARRID"
},
"callbackParameters": [
{
"name": "BOOKID"
},
{
"name": "CARRID"
},

or even if you don't need additional information for the parameters.

Suggested change
"sit2ObjCbPar": [
{
"sitncallbackparamname": "BOOKID"
},
{
"sitncallbackparamname": "CARRID"
},
"parameters": [ "BOOKID", "CARRID"

Comment on lines +377 to +378
"sitnobjvhsrvcpathtype": "01",
"sitnobjvhsrvcscope": "01",
Copy link
Contributor

Choose a reason for hiding this comment

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

Enum?

@schneidermic0 schneidermic0 changed the title Create sito-v1.json [SITO] File format for situation objects Jul 12, 2022
@schneidermic0
Copy link
Contributor

As far as I can see this PR is replaced by #380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants