Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
11 changes: 2 additions & 9 deletions abaplint.jsonc
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"global": {
"files": "/file-formats/**/*.*",
"exclude": ["/examples/"],
"skipGeneratedGatewayClasses": true,
"skipGeneratedPersistentClasses": true,
"skipGeneratedFunctionGroups": true,
"useApackDependencies": false,
"skipIncludesWithoutMain": false
"exclude": ["/examples/"]
},
"dependencies": [],
"syntax": {
"version": "v702",
"errorNamespace": ".",
"globalConstants": [],
"globalMacros": []
"errorNamespace": "."
},
"rules": {
"align_parameters": true,
Expand Down
50 changes: 50 additions & 0 deletions file-formats/docu-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$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/longtexts-v1.json",
"title": "ABAP Daemon",
"title": "Documentation",
"description": "documentation",
"type": "object",
"properties": {
"formatVersion": {
"title": "ABAP File Format Version",
"description": "The ABAP file format version",
"type": "string",
"const": "1"
Comment thread
albertmink marked this conversation as resolved.
},
"lines": {
"title": "Start Type",
"description": "Start type",
"type": "array",
"items": {
"title": "Long Text Line",
"description": "Long text line with format and content",
"type": "object",
"properties": {
"format": {
"title": "Format",
"description": "Paragraph format, max. length 2",
"type": "string",
"maxLength": 2
},
"line": {
"title": "Line",
"description": "Long text line content, max. length 72",
"type": "string",
"maxLength": 72
}
},
"additionalProperties": false,
"required": [
"format",
"line"
]
}
}
},
"additionalProperties": false,
"required": [
"formatVersion"
]
}
1 change: 1 addition & 0 deletions file-formats/doma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ DOMA | Domain | Dictionary
File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.doma.json` | 1 | [`zif_aff_doma_v1.intf.abap`](./type/zif_aff_doma_v1.intf.abap) | [`doma-v1.json`](./doma-v1.json) | [`z_aff_example.doma.json`](./examples/z_aff_example.doma.json)
`<name>.doma.docu.json` | 0...1 | [`zif_aff_docu_v1.intf.abap`](../zif_aff_docu_v1.intf.abap) | [`docu-v1.json`](../docu-v1.json) | [`z_aff_example.doma.docu.json`](./examples/z_aff_example.doma.docu.json)
Comment thread
albertmink marked this conversation as resolved.
13 changes: 13 additions & 0 deletions file-formats/doma/examples/z_aff_example.doma.docu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"formatVersion": "1",
"lines": [
{
"format": "P1",
"line": "This is an example long text for the domain Z_AFF_EXAMPLE."
},
{
"format": "P1",
"line": "It describes the meaning and usage of the domain values."
}
]
}
33 changes: 33 additions & 0 deletions file-formats/zif_aff_docu_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"! <p class="shorttext synchronized" lang="en">Long text types</p>
"! Types for AFF long texts
INTERFACE zif_aff_docu_v1 PUBLIC.

TYPES:
"! <p class="shorttext">Long Text Line</p>
"! Long text line with format and content
BEGIN OF ty_line,
"! <p class="shorttext">Format</p>
"! Paragraph format, max. length 2
"! $required
format TYPE c LENGTH 2,
"! <p class="shorttext">Line</p>
"! Long text line content, max. length 72
"! $required
line TYPE c LENGTH 72,
END OF ty_line,
"! <p class="shorttext">Long Text Lines</p>
"! Long text lines
ty_lines TYPE STANDARD TABLE OF ty_line WITH DEFAULT KEY.

TYPES:
"! <p class="shorttext">Documentation</p>
"! Documentation
BEGIN OF ty_main,
"! $required
format_version TYPE zif_aff_types_v1=>ty_format_version,
"! <p class="shorttext">Start Type</p>
"! Start type
lines TYPE ty_lines,
END OF ty_main.

ENDINTERFACE.
7 changes: 7 additions & 0 deletions file-formats/zif_aff_docu_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "Common types for longtexts",
"originalLanguage": "en"
}
}
3 changes: 2 additions & 1 deletion json-validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

msg_errors = list()
msg_warning = list()
schemas = sorted( glob.glob('./file-formats/*/*.json') )
schemas = sorted( glob.glob('./file-formats/*-v*.json') + glob.glob('./file-formats/*/*.json') )
examples = sorted( glob.glob('./file-formats/*/examples/*.json', recursive=True) )

def decode_json( file ):
Expand Down Expand Up @@ -42,6 +42,7 @@ def match_schema_to_data( ):
example_version = decode_json( example )[ 'formatVersion' ]
json_schema = [ schema for schema in schemas if example_type in os.path.basename(schema).split( sep = '-' )[0]
and example_version in os.path.basename(schema).split( sep='-')[1]]

try:
match[example] = json_schema.pop( 0 )
except IndexError:
Expand Down
Loading