Fix swagger codegen typings

Open
#349 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Inspect the generated models from the swagger codegen typescript-axios plugin and compare them with typescript-fetch output, focusing on the TaskProgress and TaskSummary examples. Determine whether switching plugins or addressing the typescript-axios generation issue is appropriate; done means custom models receive correct TypeScript typings while remaining usable in Node without an incompatible polyfill.

Written by the indexing model from the issue text.

Description

It seems the typescript-axios plugin does not generate correct typings, all the models have any type. The typescript-fetch plugin works as expected but is not immediately compatible with node without a "polyfill".

This get more important as we start to have more "custom" models. For example, the TaskProgress model is based off of rmf's TaskSummary message, with an additional field to indicate the current progress. These "custom" models are not reflected in rmf-models and must be imported from api-client. In the future, dashboard and react-component might not use rmf-models directly anymore, all model definitions will come from api-client.

We can either switch to typescript-fetch or attempt to fix typescript-axios upstream. Note that swagger codegen is a java project so that requires a different set of expertise.

Dominant language
TypeScript
Stars
140
Forks
87
Avg merge
1d 3h
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from open-rmf/rmf-web

All issues in open-rmf/rmf-web

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.