cohere-toolkit
chore(toolkit): migrate from openapi-typescript-codegen to @hey-api/openapi-ts
#345
Merged

chore(toolkit): migrate from openapi-typescript-codegen to @hey-api/openapi-ts #345

knajjars merged 1 commit into main from khalil/upgrade-openapi-generator
knajjars
knajjars325 days ago (edited 325 days ago)❤ 1

We are currently using an unmaintained library for generating our API schema.

We have an issue where the schema type is not properly being generated for UpdateAgentToolMetadata. The type in backend/schemas is artifacts: Optional[list[dict]] = None which generates properly the openapi schema, but the typescript library does not generate the correct code, therefore we have a need to update.

We are updating from openapi-typescript-codegen to @hey-api/openapi-ts, which is the package they recommend we start using, and the good thing is that because it is a maintained forked of openapi-typescript-codegen the migration was easy, additionally we benefit from new and improved features for type-safety.

Everything was tested locally to work.

Summary of changes:

  • updated Typescript to 5.x, this is a requirement for the new Openapi client generator.
  • removed openapi-typescript-codegen
  • installed @hey-api/openapi-ts
  • added config file openapi-ts.config.ts
knajjars chore(toolkit): update open-api client generator
fddb8749
knajjars knajjars requested a review from EugeneLightsOn EugeneLightsOn 325 days ago
knajjars knajjars requested a review from malexw malexw 325 days ago
knajjars knajjars requested a review from scottmx81 scottmx81 325 days ago
knajjars knajjars requested a review from tianjing-li tianjing-li 325 days ago
knajjars knajjars requested a review 325 days ago
codecov-commenter
codecov-commenter325 days ago

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.46%. Comparing base (d75e9fa) to head (fddb874).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #345   +/-   ##
=======================================
  Coverage   86.46%   86.46%           
=======================================
  Files         178      178           
  Lines        6873     6873           
=======================================
  Hits         5943     5943           
  Misses        930      930           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tomtobac
tomtobac approved these changes on 2024-07-03
tomtobac325 days ago

knajjars knajjars merged 9125660f into main 325 days ago
knajjars knajjars deleted the khalil/upgrade-openapi-generator branch 325 days ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone