eclipse-esmf / esmf-sdk

Load Aspect Models and their artifacts as Java code; share components to realize SAMM as code
https://eclipse-esmf.github.io/esmf-developer-guide/index.html
Mozilla Public License 2.0
25 stars 12 forks source link

[Task]: Include SAMM version in gen files / Include model version in gen files #485

Closed catroest closed 9 months ago

catroest commented 10 months ago

Is your task related to a problem? Please describe. The application developers would like to know what version of SAMM was used in the modeling. Also they want to know what version of the model itself (io.catenax.generic.digital_product_passport_2.0.0) was used. We know this information is saved in the turtle file.

Describe the solution you'd like Include a header (at least) in the json payload. Possible examples: <?language version="2.0.0" language type="SAMM"?> and <?model version="io.catenax.generic.digital_product_passport_2.0.0"?>

Additional context Example of a header for encoding: <?xml version="1.0" encoding="UTF-8"?>

atextor commented 10 months ago

Hi @catroest, what exactly do you mean with "gen file"? Do you mean files such as documentation, Java code or OpenAPI specs generated from an Aspect Model using samm-cli?

Include a header (at least) in the json payload. Possible examples: <?language version="2.0.0" language type="SAMM"?> and <?model version="io.catenax.generic.digital_product_passport_2.0.0"?>

I'm sorry I don't understand correctly. Generated JSON sample payload (or any other JSON payloads) correspond to the data described by an Aspect Model, so if you think it should contain additional fields, you can add corresponding Properties in the Aspect Model. The JSON format has no concept of headers. The examples you give are not JSON at all, but rather look like XML.

What is possible, is for the generation of JSON Schema/OpenAPI description (but not the JSON payload described by it) to include meta data that refers to the Aspect Model that it was generated from. A discussion on this feature can be found in https://github.com/eclipse-esmf/esmf-sdk/issues/340.

Lastly I would add, I don't think having an explicit link to the used SAMM version would be helpful anyways. If you have a references to the Aspect Model URN, you would implicitly have info about the used meta model version available.

catroest commented 9 months ago

Hello,

yes I mean the generated files. The problem came up in the recent CATENA-X project were the SAMM tooling is used. The solution to include it in the schema would be helpful, I think I misinterpreted the payload. I will foreward the discussion on the #340 to the application provider responsible.

This ticket can now be closed, as the topic is discussed in another ticket.

matbmoser commented 9 months ago

I created a proposal here https://github.com/eclipse-esmf/esmf-sdk/issues/491. In this way we can get way more information.