Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate typescript client from fastapi openapi.json #96

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

lkeegan
Copy link
Member

@lkeegan lkeegan commented Sep 27, 2024

  • add export.py script to backend to generate openapi.json
  • add generated openapi.json file
  • add autogenerated typescript fetch api client in src/lib/client using hey-api/openapi-ts
  • add hey-api/openapi-ts and hey-api/client-fetch to frontend deps
  • add openapi-ts to package.json scripts
  • add openapi-ts config file
  • run pnpm openapi-ts
  • automatically export openapi.json and generate openapi-ts client code in CI

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 0.19763% with 1010 lines in your changes missing coverage. Please review.

Project coverage is 14.98%. Comparing base (2c27e50) to head (7692cd7).

Files with missing lines Patch % Lines
frontend/src/lib/client/schemas.gen.ts 0.14% 705 Missing ⚠️
frontend/src/lib/client/services.gen.ts 0.00% 278 Missing and 1 partial ⚠️
mondey_backend/src/mondey_backend/export.py 0.00% 13 Missing ⚠️
frontend/openapi-ts.config.ts 0.00% 8 Missing and 1 partial ⚠️
frontend/src/lib/client/index.ts 0.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
- Coverage   19.43%   14.98%   -4.45%     
==========================================
  Files          75       81       +6     
  Lines        3371     4383    +1012     
  Branches      106      111       +5     
==========================================
+ Hits          655      657       +2     
- Misses       2663     3670    +1007     
- Partials       53       56       +3     

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

- add export.py script to backend to generate openapi.json
- add generated openapi.json file
- add autogenerated typescript fetch api client in src/lib/client using hey-api/openapi-ts
- add hey-api/openapi-ts and hey-api/client-fetch to frontend deps
- add openapi-ts to package.json scripts
- add openapi-ts config file
- run pnpm openapi-ts
- automatically export openapi.json and generate openapi-ts client code in CI
@lkeegan lkeegan force-pushed the openapi branch 2 times, most recently from d3fd142 to 7692cd7 Compare September 27, 2024 19:48
Copy link

sonarcloud bot commented Sep 27, 2024

@lkeegan lkeegan merged commit 9316e52 into main Oct 7, 2024
13 checks passed
@lkeegan lkeegan deleted the openapi branch October 7, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants