Skip to main content

Use swagger-client to make calls to API from client

User Story: [#153793371]

[context and problem statement] [decision drivers | forces]

Considered Alternatives

Decision Outcome

  • Chosen Alternative: swagger client
  • Allows use to dog-food our Swagger config with minimal setup and rapidly develop client code that uses API

Pros and Cons of the Alternatives

swagger-client

  • + dynamically generated from swagger.yaml
  • + no install or make tasks required
  • - documentation is spotty
  • - error handling benefit is unclear until we have more API to work against

Swagger Codegen

  • + generates a module ready for publishing on NPM (which might be useful for TSPs in future)
  • + have static code you can see
  • - usage seemed cumbersome and verbose
  • - have to install java or use docker container to set up

roll your own

  • + complete control over
  • - API calls can deviate from swagger configuration
  • - manual maintenance