Sage-Bionetworks / research-benchmarking-technology

Main repository of the Research & Benchmarking Technology Team
Apache License 2.0
1 stars 1 forks source link

Investigate Angular 11.x and RxJS clients generated with OpenAPI Generator #25

Closed tschaffter closed 3 years ago

tschaffter commented 3 years ago

Test with one of the NLP Sandbox microservice (e.g. date annotator). If the client library is intuitive to use, this could become a component of the ROCC Angular app.

https://github.com/OpenAPITools/openapi-generator#overview

tschaffter commented 3 years ago

Relevant client types from npx @openapitools/openapi-generator-cli list:

tschaffter commented 3 years ago

Angular client library

Pros:

Cons:

Decision: The pros seems to overweight the cons.

tschaffter commented 3 years ago

Node client library

Pros:

Cons:

Decision: Not as good as the Angular client library

tschaffter commented 3 years ago

RxJS client library

Pros:

Cons:

Others:

Decision: The Angular client library includes all the benefits of the RxJS library without the cons.

tschaffter commented 3 years ago

Still need to decide between:

  1. store the client library in its own GH repo and push client to npmjs OR
  2. integrate the files (interfaces, Angular services) created by the OpenAPI Generator to the client codebase (e.g. ROCC Angular App)

One element in favor of Option 1 is if the client relies on API services generated from different OpenAPI documents. The Angular library client are nicely bundled and the documentation in the README describe how to integrate multiple Angular library clients into an Angular app. The cost of maintaining the library client could be made very small if all it takes is to rerun the generator fed with the new version of the OpenAPI document. This could even be automated using GH workflow by configuring the creation of a PR when a new API version is released (see docker-elk update.yml workflow).

tschaffter commented 3 years ago

@vpchung I created the client library Sage-Bionetworks/rocc-angular. Both the interfaces and services created look great!