-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
enhancementNew feature or requestNew feature or requestv2.0Pertains to the v2.0 branchPertains to the v2.0 branch
Description
Description
The current client utilizes a handwritten typescript sdk which is tedious to maintain in sync with a changing python api.
Because the API is OpenAPI 3.0, we can instead utilize openapi-generator to create the javascript sdk.
https://openapi-generator.tech/
Technical Notes
- Install the openapi-generator-cli within the development environment
npm install @openapitools/openapi-generator-cli -g- Install java
apt update && apt install -y default-jre- Generate the typescript sdk
openapi-generator-cli generate -i http://localhost:5000/api/v1/openapi.json -g typescript-fetch -o ./generated-ts-sdkThe following folder structure was generated in my case:
generated-ts-sdk/
|-- apis
| |-- AnnotationApi.ts
| |-- AnnotationClassApi.ts
| |-- ImageApi.ts
| |-- NotificationApi.ts
| |-- ProjectApi.ts
| |-- SettingApi.ts
| |-- TileApi.ts
| `-- index.ts
|-- index.ts
|-- models
| |-- AnnClassResp.ts
| |-- AnnResp.ts
| |-- GetAnnByTileIdsArgs.ts
| |-- GetAnnWithinPolyArgs.ts
| |-- ImageResp.ts
| |-- ModelError.ts
| |-- NotificationResp.ts
| |-- OperationArgs.ts
| |-- PaginationMetadata.ts
| |-- PostAnnsArgs.ts
| |-- PostProjectArgs.ts
| |-- ProjectResp.ts
| |-- PutAnnArgs.ts
| |-- PutProjectArgs.ts
| |-- SearchTileByPolygonArgs.ts
| |-- SettingResp.ts
| |-- TileBoundingBoxResp.ts
| |-- TileIdResp.ts
| |-- TileResp.ts
| `-- index.ts
`-- runtime.ts
Additionally, sdk documentation can be auto-generated using typedoc tool:
https://typedoc.org/documents/Overview.html
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestv2.0Pertains to the v2.0 branchPertains to the v2.0 branch