Client classes for REST Clients
Create Client classes for various Languages
Client classes for entities (e.g Party, Invoices etc.) are required to build a REST client application. The following description
provides a way to conveniently create such classes.
Prerequistes:
Full description can be found here:
The Java Runtime Environment can be downloaded <here>
Wget can be downloaded <here>
https://sourceforge.net/projects/gnuwin32/files/wget/1.11.4-1/wget-1.11.4-1-setup.exe/download?use_mirror=excellmedia
Remark:
Wget is only required to download the swagger-codegen-cli-2.3.1.jar, also can be downloaded manually.
Wget is only required to download the swagger-codegen-cli-2.3.1.jar, also can be downloaded manually.
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
Remark:
It is also possible to run swagger-codegen in a docker container, but this requiers a professional version of Windows)
-
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.20/swagger-codegen-cli-3.0.20.jar -O swagger-codegen-cli.jar
-
Copy the \swagger-codegen-cli.jar into directory modules\swagger-codegen-cli\target\
Run wget with the commande (step1) in a cmd console
or for Windows user
1. PowerShell: Invoke-WebRequest -OutFile swagger-codegen-cli.jar https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.20/swagger-codegen-cli-3.0.20.jar
-
Copy the \swagger-codegen-cli.jar into directory modules\swagger-codegen-cli\target\
java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://websolution.topal.ch/swagger/docs/1.0/ -l python -o c:\temp\python_api_client
Base URL to retrieve the Topal swagger.json specification:
https://websolution.topal.ch/swagger/docs/1.0/
https://websolution.topal.ch/swagger/docs/1.0/
Examples of client class generation for different programming languages
java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://websolution.topal.ch/swagger/docs/1.0/ -l python -o c:\temp\python_api_client
java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://websolution.topal.ch/swagger/docs/1.0/ -l csharp -o c:\temp\csh_api_client
java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://websolution.topal.ch/swagger/docs/1.0/ -l r -o c:\temp\r_api_client
Clone OpenAPI Generator
git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
Jar location: https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0-beta/openapi-generator-cli-5.0.0-beta.jar
Jar location: https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0-beta/openapi-generator-cli-5.0.0-beta.jar