Skip to content

Developers notes

Piotr Kosiński edited this page Aug 31, 2021 · 2 revisions

Client generation steps (assumes ../dsb) is cloned https://github.com/energywebfoundation/dsb repository

Install generator

npm install @openapitools/openapi-generator-cli -g
  1. Generate client
openapi-generator-cli generate -i ../dsb/specs/schema.yaml -o ./ -g python --package-name dsb_client --additional-properties=packageVersion=<VERSION> --git-repo-id "dsb-client-python" --git-user-id "energywebfoundation"

Specify packageVersion according to SemVer rules.

  1. git checkout requirements.txt

  2. Make sure setup.py REQUIRES = [ ] section corresponds to requirements.txt file

  3. Retain README.md file first section

  4. Find and replace

Find 👇

configuration = dsb_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): access-token
configuration = dsb_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

Replace with 👇

configuration = dsb_client.Configuration(
    host = "http://localhost",
    access_token = 'YOUR_BEARER_TOKEN'
)

Clone this wiki locally