-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95f02af
commit a4673fa
Showing
8 changed files
with
278 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CSNM File Format | ||
|
||
File | Cardinality | Definition | Schema | Example | ||
:--- | :--- | :--- | :--- | :--- | ||
`<name>.csnm.json` | 1 | [`zif_aff_csnm_v1.intf.abap`](./type/zif_aff_csnm_v1.intf.abap) | [`csnm-v1.json`](./csnm-v1.json) | [z_aff_example_abcd.csnm.json](./examples/z_aff_example_abcd.csnm.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"$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/csnm/csnm-v1.json", | ||
"title": "CSN Model Transport Object", | ||
"description": "CSN model transport object", | ||
"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" | ||
] | ||
}, | ||
"generalInformation": { | ||
"title": "General Information", | ||
"description": "General Information", | ||
"type": "object", | ||
"properties": { | ||
"csnFileNames": { | ||
"title": "CSN File Names", | ||
"description": "CSN file name", | ||
"type": "array", | ||
"items": { | ||
"title": "CSN File", | ||
"description": "CSN file", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "CSN File Name", | ||
"description": "CSN file name", | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"formatVersion", | ||
"header" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"formatVersion": "1", | ||
"header": { | ||
"abapLanguageVersion": "standard" | ||
"description": "Example CSN model for ABAP file formats", | ||
"originalLanguage": "en" | ||
}, | ||
"generalInformation": { | ||
"csnFileNames": [ | ||
{ | ||
"name": "model_parsed.csn" | ||
}, | ||
{ | ||
"name": "model_inferred.csn" | ||
} | ||
] | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
file-formats/csnm/example/z_aff_example_csnm.csnm.model_inferred.csn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"definitions": { | ||
"Foo": { | ||
"kind": "entity", | ||
"elements": { | ||
"name": { | ||
"key": true, | ||
"type": "cds.String" | ||
}, | ||
"vorname": { | ||
"key": true, | ||
"type": "cds.String" | ||
} | ||
} | ||
}, | ||
"Bar": { | ||
"kind": "entity", | ||
"projection": { | ||
"from": { | ||
"ref": [ | ||
"Foo" | ||
] | ||
}, | ||
"columns": [ | ||
{ | ||
"ref": [ | ||
"name" | ||
], | ||
"as": "Name" | ||
}, | ||
{ | ||
"ref": [ | ||
"vorname" | ||
], | ||
"as": "Vorname" | ||
} | ||
] | ||
}, | ||
"elements": { | ||
"Name": { | ||
"key": true, | ||
"type": "cds.String" | ||
}, | ||
"Vorname": { | ||
"key": true, | ||
"type": "cds.String" | ||
} | ||
} | ||
} | ||
}, | ||
"meta": { | ||
"creator": "CDS Compiler v3.3.2", | ||
"flavor": "inferred" | ||
}, | ||
"$version": "2.0" | ||
} |
56 changes: 56 additions & 0 deletions
56
file-formats/csnm/example/z_aff_example_csnm.csnm.model_parsed.csn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"definitions": { | ||
"Foo": { | ||
"kind": "entity", | ||
"elements": { | ||
"name": { | ||
"key": true, | ||
"type": "cds.String" | ||
}, | ||
"vorname": { | ||
"key": true, | ||
"type": "cds.String" | ||
} | ||
} | ||
}, | ||
"Bar": { | ||
"kind": "entity", | ||
"projection": { | ||
"from": { | ||
"ref": [ | ||
"Foo" | ||
] | ||
}, | ||
"columns": [ | ||
{ | ||
"ref": [ | ||
"name" | ||
], | ||
"as": "Name" | ||
}, | ||
{ | ||
"ref": [ | ||
"vorname" | ||
], | ||
"as": "Vorname" | ||
} | ||
] | ||
}, | ||
"elements": { | ||
"Name": { | ||
"key": true, | ||
"type": "cds.String" | ||
}, | ||
"Vorname": { | ||
"key": true, | ||
"type": "cds.String" | ||
} | ||
} | ||
} | ||
}, | ||
"meta": { | ||
"creator": "CDS Compiler v3.3.2", | ||
"flavor": "inferred" | ||
}, | ||
"$version": "2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"! ABAP File Format for CSN Model Transport Object Generic Editor | ||
"! | ||
"! As very first solution, one CSN file could be enough | ||
INTERFACE zif_aff_csnm_v1 | ||
PUBLIC. | ||
|
||
TYPES: | ||
"! <p class="shorttext">CSN File</p> | ||
"! CSN file | ||
BEGIN OF ty_csn_file, | ||
"! <p class="shorttext">CSN File Name</p> | ||
"! CSN file name | ||
name TYPE string, | ||
END OF ty_csn_file. | ||
|
||
"! <p class="shorttext">CSN Files</p> | ||
"! CSN files | ||
TYPES ty_csn_file_names TYPE STANDARD TABLE OF ty_csn_file WITH DEFAULT KEY. | ||
|
||
TYPES: | ||
"! <p class="shorttext">General Information</p> | ||
"! General information | ||
BEGIN OF ty_general_information, | ||
"! <p class="shorttext">CSN File Names</p> | ||
"! CSN file name | ||
csn_file_names TYPE ty_csn_file_names, | ||
END OF ty_general_information. | ||
|
||
TYPES: | ||
"! <p class="shorttext">CSN Model Transport Object</p> | ||
"! CSN model transport object | ||
BEGIN OF ty_main, | ||
"! <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 Information</p> | ||
"! General Information | ||
general_information TYPE ty_general_information, | ||
END OF ty_main. | ||
ENDINTERFACE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"formatVersion": "1", | ||
"header": { | ||
"description": "CSN AFF type for CSNM repository object", | ||
"originalLanguage": "en" | ||
} | ||
} |