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 proxy flag and category to interfaces #87

Merged
merged 14 commits into from
May 22, 2021
2 changes: 2 additions & 0 deletions file-formats/intf/format.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ File | Content
--- | ---
[`zif_aff_example.intf.json`](./examples/zif_aff_example.intf.json) | Properties and descriptions of the ABAP interface
[`zif_aff_example.intf.abap`](./examples/zif_aff_example.intf.abap) | Interface source code

Documentation of interfaces is not covered, yet.
22 changes: 22 additions & 0 deletions file-formats/intf/intf.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,28 @@
"abapLanguageVersion"
]
},
"category": {
"title": "Interface category",
"description": "Interface category",
"type": "string",
"enum": [
"standard",
"classicBadi",
"dbProcedureProxy",
"enterpriseService"
],
"enumDescriptions": [
"Standard interface",
"Interface definition of a classic BAdI",
"Generated interface of a database procedure proxy",
"Generated interface of enterprise services"
]
},
"proxy": {
"title": "Interface is a proxy interface",
"description": "Interface is a proxy interface",
"type": "boolean"
},
"types": {
"type": "array",
"title": "Type Descriptions",
Expand Down
26 changes: 22 additions & 4 deletions file-formats/intf/zif_aff_intf_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
INTERFACE zif_aff_intf_v1 PUBLIC.

TYPES:
category_base TYPE n LENGTH 2,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a false-positive, isn't it? The type is used in the ENUM below as base type

Copy link
Collaborator

Choose a reason for hiding this comment

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

that looks like a false positive, I'll fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know, if I shall add an issue to abaplint

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@larshp Thanks

"! Interface category
BEGIN OF ENUM category BASE TYPE category_base,
"! Standard interface
standard VALUE IS INITIAL,
"! Interface definition of a classic BAdI
classic_badi VALUE '01',
"! Generated interface of a database procedure proxy
db_procedure_proxy VALUE '65',
"! Generated interface of enterprise services
enterprise_service VALUE '90',
END OF ENUM category.

TYPES:
"! Component description (e.g., for methods, attributes, types)
BEGIN OF component_description,
Expand All @@ -20,9 +34,9 @@ INTERFACE zif_aff_intf_v1 PUBLIC.
"! Description of the component
description TYPE zif_aff_types_v1=>description_60,
"! Parameter descriptions
parameters TYPE subcomponent_descriptions,
parameters TYPE subcomponent_descriptions,
"! Exception descriptions
exceptions TYPE subcomponent_descriptions,
exceptions TYPE subcomponent_descriptions,
END OF method,
"! Method descriptions
methods TYPE SORTED TABLE OF method WITH UNIQUE KEY name.
Expand All @@ -35,15 +49,19 @@ INTERFACE zif_aff_intf_v1 PUBLIC.
"! Description of the component
description TYPE zif_aff_types_v1=>description_60,
"! Parameter descriptions
parameters TYPE subcomponent_descriptions,
parameters TYPE subcomponent_descriptions,
END OF event,
"! Event descriptions
events TYPE SORTED TABLE OF event WITH UNIQUE KEY name.

TYPES:
"! Interface properties
BEGIN OF main,
header TYPE zif_aff_types_v1=>head-header,
header TYPE zif_aff_types_v1=>header,
"! Interface category
category TYPE category,
"! Interface is a proxy interface
proxy TYPE abap_bool,
"! Type descriptions
types TYPE component_descriptions,
"! Attribute descriptions
Expand Down
25 changes: 10 additions & 15 deletions file-formats/intf/zif_aff_types_v1.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,20 @@ INTERFACE zif_aff_types_v1 PUBLIC.
END OF ENUM abap_language_version.

TYPES:
"! Head to be included in each object type
BEGIN OF head,
"! Location of the corresponding JSON schema
schema TYPE string,
schneidermic0 marked this conversation as resolved.
Show resolved Hide resolved
"! The header for an ABAP main object
BEGIN OF header,
"! Description of the ABAP object
description TYPE string,
"! Original language of the ABAP object
master_language TYPE language,
"! ABAP language version
abap_langu_version TYPE abap_language_version,
END OF header,
END OF head.
"! The header for an ABAP main object
BEGIN OF header,
"! Description of the ABAP object
description TYPE string,
"! Original language of the ABAP object
master_language TYPE language,
"! ABAP language version
abap_langu_version TYPE abap_language_version,
END OF header.

"! Description with 60 characters
TYPES description_60 TYPE c LENGTH 60.

"! Object name with max. length 30
TYPES object_name_30 TYPE c LENGTH 30.

ENDINTERFACE.
ENDINTERFACE.