Use swagger-client to make calls to API from client
User Story: [#153793371]
[context and problem statement] [decision drivers | forces]
Considered Alternatives
- swagger-client
- Swagger Codegen
- roll our own (fetch)
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 fromswagger.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