/yacog4openapi

Yast Another Code Generator Tool 4 Open API

Primary LanguagePythonApache License 2.0Apache-2.0

Yast Another Code Generator Tool 4 OpenAPI

Currently, prototype status


GitHub tag GitHub issues Apache 2.0 license made-with-micropython Maintenance Buymeacoffee

Table of Contents

What About?

This project is currently a small prototype project how to read an Open API file and use a template engine in Python.

Installation

All required Python dependencies are declared in the requirement.txt file and must be installed with the following command by using the Python package manager Pip:

pip install -r requirements.txt

Configuration

{
    "input": {
        // Default OpenAPI definition file
        "source": "../test/openapi.json"
    },    
    // Template to use
    "template": "resources/delphi-unit.jinja2",
    // File generated output
    "output": "../out/uRestServiceClient.pas",
    // Open API datatype mappings
    "datatype-map": {
        "number,float":  "Single",
        "number,double": "Double",
        "number,": "Single",

        "integer,in32": "Integer",
        "integer,int64": "Int64",
        "integer,": "Integer",

        "string,byte": "String",
        "string,binary": "String",
        "string,": "String",

        "string,date": "TDate",
        "string,date-time": "TDateTime",

        "string,uuid": "String",

        "boolean,": "Boolean"
    }
}

tbc

Using

Creating output

Example

src/genclient.py --source=test/openapi.json --template=test/delphi-test-example.jinja2 --output=test-output/delphi-unit.pas

Supported parameters

To get an overview of the supported parameters, enter the following command in your shell:

src/genclient.py --help

tbc

Contribution

tbd