sap / abap-file-formats-tools Goto Github PK
View Code? Open in Web Editor NEWTools for the development of ABAP file formats
License: MIT License
Tools for the development of ABAP file formats
License: MIT License
So far, we only write a warning during generation process if one of the following does not apply:
The last point may cause confusion since the JSON schema only knows the JSON enum values and not the ABAP values. Hence, if a component - which value corresponds to an initial ABAP value - is missing in the JSON data, it is not clear what value it has.
Therefore, also (non-required) components of type enum with an initial ABAP value should specify a default value.
For sake of completion: Should also required components of type enum specify a default? Actually, a validation against the JSON schema would fail if a required component was missing. So such a component should always be in the JSON data.
https://abapedia.org/steampunk-2202-api/stringtab.ttyp.html
used at least one place,
If an AFF type contains a nested structure with internal tables in which the nesting consists on the same table name on different nesting levels. The schema generation will dump here:
Reason: All nesting information for tables with the same name is removed from the table_buffer
in zcl_aff_writer_json_schema
.
Here is some example code. There is the field or
twice on different levels.
"! <p class="shorttext">Filter Condition</p>
"! Filter condition
TYPES ty_value TYPE string.
TYPES:
"! <p class="shorttext">OR Filter Conditions</p>
"! OR filter conditions
BEGIN OF ty_or,
"! <p class="shorttext">Filter Condition</p>
"! Simple filter condition
value TYPE ty_value,
END OF ty_or.
TYPES:
"! <p class="shorttext">AND Filter Conditions</p>
"! AND filter conditions
BEGIN OF ty_and,
"! <p class="shorttext">Filter Condition</p>
"! Simple filter condition
value TYPE ty_value,
"! <p class="shorttext">OR Filter Conditions</p>
"! OR filter conditions
or TYPE standard table of ty_or with default key,
END OF ty_and.
TYPES:
"! <p class="shorttext">OR Filter Conditions</p>
"! OR filter conditions on top level
BEGIN OF ty_or_top,
"! <p class="shorttext">Filter Condition</p>
"! Simple filter condition
value TYPE ty_value,
"! <p class="shorttext">AND Filter Conditions</p>
"! AND filter conditions
and TYPE standard table of ty_and with default key,
END OF ty_or_top.
TYPES:
"! <p class="shorttext">Filter Values</p>
"! Filter values
BEGIN OF ty_filter_values,
"! <p class="shorttext">Filter Value</p>
"! Filter value
value TYPE ty_value,
"! <p class="shorttext">OR Filter Conditions</p>
"! OR filter conditions
or TYPE standard table of ty_or_top with default key,
"! <p class="shorttext">AND Filter Conditions</p>
"! AND filter conditions
and TYPE standard table of ty_and with default key,
END OF ty_filter_values.
I think cl_oo_abap_doc_reader
is the only left? close this issue and open a separate for tracking cl_oo_abap_doc_reader
?
Originally posted by @larshp in #3 (comment)
Did you generate the output of the readme file using our program?
If so, there seems to be an issue with the generator for the readme file.
`<name>.sajt.json` | 1 | [`zif_aff_sajt_v1.intf.abap`](./type/zif_aff_sajt_v1.intf.abap) | [`sajt-v1.json`](./sajt-v1.json) | [`z_aff_example_sajt.sajt.json](./examples/z_aff_example_sajt.sajt.json)
Originally posted by @schneidermic0 in SAP/abap-file-formats#578 (comment)
Refactor change RSWSOURCET to STRING_TABLE
There could be some more automatic checks for validating the ABAP type.
E.g., it could be checked whether all types and constants provide a title and a description.
See SAP/abap-file-formats#561
A violation against the OSS Rules of Play has been detected.
Rule ID: rl-reuse_tool-4
Explanation: Is it compliant with REUSE rules? No
Find more information at: https://sap.github.io/fosstars-rating-core/oss_rules_of_play_rating.html
PCRE regexes is 755, latest dev edition is 754
need to decide the target version of this repository, I'd suggest it follows the latest dev edition
tho it might be difficult, PCRE is a good feature
When calling the AFF framework, we pass a cl_aff_log object. For logging the classes in the customer namespaces, we use zcl_aff_log. Right now, we print only one log.
We want to print both log messages.
looks like ZIF_AFF_WRITER~VALIDATE is only used in unit tests?
https://github.com/SAP/abap-file-formats-tools/search?q=IF_AFF_TYPES_V1
as such, I'd suggest that this project is as independent as possible
ie. not referencing or using anything from https://github.com/SAP/abap-file-formats
For a given ABAP object type, the report writes the folder . This contains:
This is the central place for SAP internal developers (prerequisite is the AFF framework in the ABAP system) to contribute the file format specification for the ABAP file formats, for now.
To generate the JSON Schema, it is still recommended to use the program https://github.com/SAP/abap-file-formats-tools/blob/main/src/z_generate_json_schema.prog.abap
okay, next suggestion: delete METHOD is_callback_class_valid.
and just let the code dump if the class is not valid(does not implement the correct interface), the methods in the class are called dynamically anyhow
Originally posted by @larshp in #58 (comment)
Very generic and maybe we want adjust some rules.
refactor SELECTs to class like CL_OO_CLASSNAME_SERVICE, not sure exactly what classes will work, dont have access to a system right now
alternatively, can an interface be added? so instead of checking the class, the class implements an interface?
rename some of the renamed unit tests from #158
suggest using CL_OO_CLASSNAME_SERVICE=>GET_CLASS_CATEGORY instead
no function module calls, its 2022
zcl_aff_abap_doc_reader
takes the source as input in create_instance
cl_oo_abap_doc_reader
takes the name of the class/interface as input
to glue it together, we should read the source code, but which method is preferred to read class and intf source code? CL_OO_CLIF_SOURCE
?
https://github.com/SAP/abap-file-formats-tools/search?q=RSWSOURCET
some left/added after #14
For ranges, it would be great to use the ABAP statement TYPE RANGE OF
instead of defining own range structures.
Adopt the GitHub Action by
sed -i '/CLASS\ ltc_generator\ I/,/ENDCLASS./d' saff_generate_repo.prog.abap
sed -i '/CLASS\ ltc_generator\ D/,/ENDCLASS./d' saff_generate_repo.prog.abap
add use in
Currently the max maxLength in the generated json schemas is 255 due to a bug.
For example if the abap type has a field "name type c length 512" the schema generator will put "maxLength":255 into the schema.
I am working on this problem
CHAR10
https://abapedia.org/steampunk-2202-api/char10.doma.html
can TYPE c LENGTH 10
be used instead?
There is a validation error for AOBJ:
> [email protected] generate
> rm -rf generated && node aff.mjs
AOBJ
formats/generate/node_modules/@abaplint/runtime/build/src/types/character.js:38
this.value = value.get() + "";
^
TypeError: Cannot read properties of null (reading 'get')
at Character.set (/home/runner/work/abap-file-formats/abap-file-formats/generate/node_modules/@abaplint/runtime/build/src/types/character.js:38:32)
at SelectDatabase.select (/home/runner/work/abap-file-formats/abap-file-formats/generate/node_modules/@abaplint/runtime/build/src/statements/select.js:31:75)
Node.js v18.14.2
Error: Process completed with exit code 1.
Copied from https://github.com/SAP/abap-file-formats/actions/runs/4385938716/jobs/7719410914
I've disabled rule dangerous_statement in the config
suggest refactoring and enabling the rule again
suggest that this code, as such, generate the code to memory, where it can be picked up and written as a file to a git repository, from which the dangerous/import can happen
two calls to be replaced,
https://github.com/SAP/abap-file-formats-tools/search?q=create_pcre
I cannot test it yet, ie I cannot replace it reliably
class https://github.com/SAP/abap-file-formats-tools/blob/main/src/zcl_aff_generator.clas.abap is keywords upper
class https://github.com/SAP/abap-file-formats-tools/blob/main/src/zcl_aff_abap_doc_parser.clas.abap is keywords lower
which style does the team prefer?
There are some left overs from the Abap development system, that are not contained in this repository.
Many won't make it into the repository and hence should be removed.
The list
Any thoughts on enabling https://rules.abaplint.org/line_only_punc/ ?
there are 170 occurrences which can be quick fixed, https://abaplint.app/stats/SAP/abap-file-formats-tools/disabled_rules
its part of the style guide, https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
the abap-file-formats is in 702 syntax, so enums are out of scope?
suggest deleting the related logic in this repository, less code is easier to get running, plus ENUMS in ABAP is a mess...
SYSUUID_C36
is released, https://abapedia.org/steampunk-2202-api/sysuuid_c36.dtel.html, and I think it fits with the test scenario?
plus it exists in https://github.com/open-abap/open-abap/blob/main/src/uuid/sysuuid_c36.dtel.xml
See missing contact here
add unit tests for zcl_aff_log
suggest deleting METHOD get_expected_description.
and hardcode the expected value
SMBC was updated with https://github.com/SAP/abap-file-formats/pull/416/files
looking at the code
abap-file-formats-tools/src/zcl_aff_writer_json_schema.clas.abap
Lines 336 to 341 in d3ba437
then whenever the json contains "enumTitles" it will also have "enumDescriptions"
however, this is not the case for https://github.com/SAP/abap-file-formats/blob/main/file-formats/smbc/smbc-v1.json#L147 ?
something looks wrong...
macros are bad ๐
suggest using APPEND VALUE # instead
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.