Use it directly as a git dependency. That way, you get all the latest updates and bug fixes, without having to download the package separately.
The non-dev branches function as release branches. For example, branch 1.16 corresponds to the generated plugin for 'Swagger v1.16'.
- Follow the steps to create a deployment token in the Gitlab repository.
- Use the deployment token and its name to add the base_openapi_client dependency in the pubspec.yaml as
...
base_openapi_client:
git:
url: https://<token_username>:<token>@sources.didata.eu/dimerce/flutter/base_openapi_client/
ref: "<branch_name>"
- Branch off of
develop(latest client), with the branch name strictly following the Swagger.json version (Swagger v1.16 -> 1.16). - Follow the remaining steps, and fix the (possible) remaining errors using this guide.
The script that should automate the whole procedure (nullifying the need for all the content below).
- Download the generation reference file, following the instructions in (this section)[#backend--swaggerjson--file].
- Run the 'Generate client' configuration. You can also run the script directly.
In case of failure of the above script and urgency, use the manual generation steps below.
- Download the latest 'openapi-generator-cli-x.x.x.jar' file from mavenCentral
- Alternatively, follow instructions at OpanAI generator site
- Put it in the
Libraryfolder
- Use
brew install openapi-generatorto install, or alternatively, follow instructions at OpanAI generator site
- Get the latest Swagger JSON file from Swagger UI
- Put in the
Libraryfolder as well
Open the terminal here at the root of the project and execute the code-generation command.
java -jar Library/openapi-generator-cli.jar generate -i Library/swagger.json -g dart-dio -o . --skip-validate-spec --additional-properties pubName=base_openapi_client --additional-properties pubLibrary=base_openapi_client.apiopenapi-generator generate -i Library/swagger.json -g dart-dio -o . --skip-validate-spec --additional-properties pubName=base_openapi_client --additional-properties pubLibrary=base_openapi_client.apiAnd the run the build-runner, following which, fix any remaining errors (see Fixing errors section).
The following is a recorded (and changing) list of errors that are needed to be fixed after the code generation.
If there is a new error, please create a new tag and add append it. If a tag is no longer an error (fix needs to be reverted), remove it from the list
| Tag Name | Reapplied in versions |
|---|---|