Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 2.24 KB

README.md

File metadata and controls

46 lines (28 loc) · 2.24 KB

APL Clients

Factory to build and publish openapi clients used in the linode/apl-tasks repo. Part of APL - Application Platform for LKE (Linode Kubernetes Engine).

Generate openapi clients for vendors

To build and publish new vendor clients, just download and inspect their openapi spec if it is suitable, then integrate it.

Steps:

  • put the api spec in src/vendors/openapi/*.json
  • add a line in bin/generate-all.sh to include your package
  • make sure the credentials used in .github/workflows/default.yaml have rights to publish that package

To create one the very first time to see if it all works:

bin/generate-client.sh $vendor $type

This will generate vendors/client/$vendor/$type, with $type being the intended environment the client will run in, i.e. node|axios (default node).

The above script uses openapi-generator tool for typescript. Read about more typescript options at: https://openapi-generator.tech/docs/generators/typescript-node

Publish as npm package

In order for others to use the generated client package, please commit the code and the github workflow will run tests and publish.

NPM: authentication and publication

To control npm access, like wiring up a private repo please follow these instructions:

Troubleshooting

Npm publish

npm ERR! Invalid version: "2.0"

Solution: Update version in api spec to make it conform to semver. E.g.: change version to 2.0.0 and then generate client once again.