-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Upgrade openapi-typescript
to 7.0.2 + swap to openapi-fetch
#18532
Upgrade openapi-typescript
to 7.0.2 + swap to openapi-fetch
#18532
Conversation
I think this looks pretty good, what's a clear improvement is that default values and constants don't automatically make attributes optional: * Ext
* @default auto
*/
- ext?: string;
+ ext: string; |
Should I give it a try to swap to |
I don't know what's better, I assume all these things need to be fixed whether we use openapi-fetch or not ? |
Yes, but if we plan to move to I think I will give it a try to replace it, and if it is too disruptive I will fall back and just fix the typing errors. |
@davelopez please do just go ahead with that and swap over; I think it's the right move and I'd be more than happy for you to take over! |
openapi-typescript
to 7.0.2 + swap to openapi-fetch
71e2f18
to
f7fdac6
Compare
2720d7b
to
cb67b8e
Compare
cb67b8e
to
2f84034
Compare
2f84034
to
267ba03
Compare
267ba03
to
7d0a276
Compare
01df758
to
296408a
Compare
296408a
to
81bdce2
Compare
As a "simple" example on how to handle the API error.
And avoid leaving the async call unresolved
With server mock and missing API configuration endpoint. The missing API mock may cause the test to not handle the rejected promise otherwise.
With server mock and missing API configuration endpoint. The missing API mock may cause the test to not handle the rejected promise otherwise.
Minimum error handling, it probably needs better error handling logic and display some feedback to the user.
And remove unnecessary code
Co-authored-by: Marius van den Beek <[email protected]>
This will avoid import side effects and will enable easy API mocking in unit tests in the future.
To use errorMessageAsString consistently
And remove unnecessary code
48206e7
to
30e39ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this. Thanks a lot for working through all of the details, this is great!
I'll leave this open till tomorrow to give others a chance to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, thanks so much @davelopez for picking this up and running with it.
Upgrade to the latest version of
openapi-typescript
. This introduces some breaking changes in particular:Maybe this is a good opportunity to continue with @dannon's work started in https://github.com/dannon/galaxy/commits/openapi-typescript-fetch-upgrade/ and swap to openapi-fetch
Update
See discussion details at #18534
TLDR; There are some more incompatibilities between the latest
openapi-typescript
generated schemas and the currentopenapi-typescript-fetcher
so, if we want to upgrade we should replace the current fetcher with the most up-to-dateopenapi-fetch
variant.TODO
fetcher
withclient
New way of querying the API
For more information see the updated client docs.
New way of mocking the API responses in the client unit test
Along with the openapi-fetch replacement, we introduced a new way of mocking API calls in the client using Mock Service Worker.
For more information see the updated docs.
How to test the changes?
License