This folder contains configuration and scripts for generating the toggl-py source from
Toggl's OpenApi (Swagger) spec.
Code generation uses a custom Docker image wrapping the
swagger-codegen-cli.
From the root of this repository
-
Create an environment file from the sample (defaults are good for now)
cp .env.sample .env
-
Then build the main Docker image:
docker compose build
Open this repository in VS Code, then Rebuild and Reopen in Container.
(Outside a devcontainer), run the Docker Compose codegen service:
docker compose run codegen(Inside the devcontainer), run the codegen script directly:
codegen/bin/run.shSome configuration values can be changed in config.json.
Other flags for swagger-codegen can be modified in the run.sh script.
Use the help.sh script to find out more about swagger-codegen-cli configuration options:
codegen/bin/help.shCustom Mustache templates used to generate the files live under ./TogglPythonClientCodegen/src/main/resources/TogglPythonClientCodegen/.
TogglPythonClientCodegen is the
custom Java class, inheriting from and overriding some behavior of Swagger's PythonClientCodegen,
serving as the "language" implementation that swagger-codegen-cli uses to generate toggl-py.