Skip to content

Latest commit

 

History

History
73 lines (60 loc) · 3.85 KB

File metadata and controls

73 lines (60 loc) · 3.85 KB

Manual

Table of contents

Usage

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'.

  1. Follow the steps to create a deployment token in the Gitlab repository.
  2. 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>"

Client generation

  1. Branch off of develop(latest client), with the branch name strictly following the Swagger.json version (Swagger v1.16 -> 1.16).
  2. Follow the remaining steps, and fix the (possible) remaining errors using this guide.

Work in progress

The script that should automate the whole procedure (nullifying the need for all the content below).

  1. Download the generation reference file, following the instructions in (this section)[#backend--swaggerjson--file].
  2. 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.

Binary installation

Java users

  1. Download the latest 'openapi-generator-cli-x.x.x.jar' file from mavenCentral
  2. Alternatively, follow instructions at OpanAI generator site
  3. Put it in the Library folder

Homebrew users

  1. Use brew install openapi-generator to install, or alternatively, follow instructions at OpanAI generator site

Backend swagger.json file

  1. Get the latest Swagger JSON file from Swagger UI
  2. Put in the Library folder as well

Execution

Open the terminal here at the root of the project and execute the code-generation command.

Jar execution

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.api

Brew package execution

openapi-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.api

And the run the build-runner, following which, fix any remaining errors (see Fixing errors section).

Fixing errors

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