You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This modification ensures that either onRequest or onResponse is required, and this is reflected in the type, allowing the issue to be detected at compile time.
Thank you for the quick response! I’m glad the suggestion makes sense. Just to clarify, I was actually planning to open a PR for this myself, as mentioned in the checklist. I’ll go ahead and submit it shortly.
If possible, I’d really appreciate your feedback once the PR is open!
Uh oh!
There was an error while loading. Please reload this page.
Description
The middleware throws the following error when neither
onRequest()
noronResponse()
is provided.Based on this, I think the type definition below could be improved by making it more explicit and better aligned with the intended behavior: https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-fetch/src/index.d.ts#L147
Proposal
It seems like the
Middleware
interface might be improved with the following modification:This modification ensures that either onRequest or onResponse is required, and this is reflected in the type, allowing the issue to be detected at compile time.
Checklist
The text was updated successfully, but these errors were encountered: