Currently, prototype status
This project is currently a small prototype project how to read an Open API file and use a template engine in Python.
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
{
"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
src/genclient.py --source=test/openapi.json --template=test/delphi-test-example.jinja2 --output=test-output/delphi-unit.pas
To get an overview of the supported parameters, enter the following command in your shell:
src/genclient.py --help
tbc
tbd