5G-MAG / rt-common-shared

Tools common to various projects
Other
3 stars 7 forks source link

Make generate_openapi Bash script generic #3

Closed rjb1000 closed 2 years ago

rjb1000 commented 2 years ago

Background

The generate_openapi Bash script:

  1. Downloads the OpenAPI Generator tool.
  2. Checks out a copy of the 5G API YAML files from 3GPP Forge.
  3. Runs the OpenAPI Generator tool over a specific YAML file to generate language-specific bindings for the specified API.

The current version of the script generates only Python bindings in step 3 for use by the 5GMS AS.

Specification

To make the script more generic (e.g. to generate any set of bindings in any language for any project), it needs additional command line parameters:

Once the language-specific bindings have been generated, they are moved into the specified target directory without changing the directory structure.

davidjwbbc commented 2 years ago

The generic script, as stated above has been implemented in PR #4, however this may still be too simple to be useful in the rt-5gms-application-function based on open5gs as that may use templates and other options in order to integrate the output with the open5gs libraries. I've asked @devbbc to check which options we need to support in this script to provide bindings compatible with open5gs (i.e. which options to openapi-generator-cli does open5gs use).

devbbc commented 2 years ago

Yes, the generic script needs to handle Open5GS template directory for 5GMS AF. This path is specified to OpenAPI generator in a config.yaml file that is passed in the -c parameter:

openapi_generator_cli generate -i ./modified/TS26512_CommonData.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi
davidjwbbc commented 2 years ago

Ok, will add that parameter to pass through the generate_openapi script.

(Just to note that the 5GMS AS uses the default openapi-generator-cli configuration and templates and so will not need to use this option.)