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
While I was trying to implement a standalone server for mocks I encountered a type mismatch. I had added the source package to read my openapi specs and output the generated handlers.
The type from openApi is RequestHandler<RequestHandlerDefaultInfo, any, any, RequestHandlerOptions>[] but the createServer expects handlers to be HttpHandler[]. The http hander type is an extension of Request handler, but is missing checkRedundantQueryParameters and matchMethod both of which are private on the Request Handler instance.
It would also be really cool if source could re-export the OpenAPI document types as well so I don't have to install the openapi-types package just for the types.
The above code does work as written as js, this is just appeasing typescript because of the mismatch.
The text was updated successfully, but these errors were encountered:
While I was trying to implement a standalone server for mocks I encountered a type mismatch. I had added the source package to read my openapi specs and output the generated handlers.
The type from
openApi
isRequestHandler<RequestHandlerDefaultInfo, any, any, RequestHandlerOptions>[]
but thecreateServer
expects handlers to beHttpHandler[]
. The http hander type is an extension of Request handler, but is missingcheckRedundantQueryParameters
andmatchMethod
both of which are private on the Request Handler instance.Example code
It would also be really cool if source could re-export the OpenAPI document types as well so I don't have to install the openapi-types package just for the types.
The above code does work as written as js, this is just appeasing typescript because of the mismatch.
The text was updated successfully, but these errors were encountered: