v0.10.0 #489
diego-aquino
announced in
Announcements
v0.10.0
#489
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
v0.10.0 is here! 🎉
Features
🛡️ Reject local unhandled requests (83e0126):
Local HTTP interceptors are now capable of rejecting unhandled requests with
action: 'reject'
. This is useful when you want to ensure that unhandled requests cause a request error. For backward compatibility, the default behavior in local interceptors is still to bypass unhandled requests. Learn more.💡 Improved unhandled request API (e53cb89)
To preserve the previous behavior, you can use
action: 'bypass'
for local interceptors andaction: 'reject'
for remote interceptors.Migration guide:
If you set an unhandled request strategy for a local interceptor, add
action: 'bypass'
to preserve the previous behavior.If you set an unhandled request strategy for a remote interceptor, add
action: 'reject'
to preserve the previous behavior.If you used an unhandled request strategy function, the
context
parameter was removed andawait context.log()
can be replaced with areturn
of the desired strategy.If you set a default unhandled request strategy, use
httpInterceptor.default.local.onUnhandledRequest
orhttpInterceptor.default.remote.onUnhandledRequest
.If you used a default unhandled request strategy function, the
context
parameter was removed andawait context.log()
can be replaced with areturn
of the desired strategy.The parameter
onUnhandledRequest.log
in the programmatic interceptor server API was changed tologUnhandledRequests
to better reflect the CLI flag.Setting
httpInterceptor.default.onUnhandledRequest
no longer affects interceptor servers in the programmatic API. To change the default logging behavior, use the parameterlogUnhandledRequests
ininterceptorServer.create(options)
.⚙️ Parsed unhandled requests (39fd1bb)
Unhandled requests are now parsed by default, just like interceptor requests.
request.body
,request.searchParams
, andrequest.pathParams
are now available for unhandled requests. This makes it easier to manipulate them and improves the consistency of the API.Deprecations
👋 Removed the types deprecated in v0.9
Full list of removed types:
HttpServiceSchema
HttpSchema
HttpServiceMethodsSchema
HttpMethodsSchema
HttpServiceMethodsSchema
HttpMethodsSchema
HttpServiceMethodSchema
HttpMethodSchema
HttpServiceRequestSchema
HttpRequestSchema
HttpServiceResponseSchemaByStatusCode
HttpResponseSchemaByStatusCode
HttpServiceResponseSchema
HttpResponseSchema
HttpServiceResponseSchemaStatusCode
HttpResponseSchemaStatusCode
HttpServiceSchemaMethod
HttpSchemaMethod
HttpServiceSchemaPath
HttpSchemaPath
LiteralHttpServiceSchemaPath
HttpSchemaPath.Literal
NonLiteralHttpServiceSchemaPath
HttpSchemaPath.NonLiteral
PathParamsSchemaFromPath
InferPathParams
ExtractHttpInterceptorSchema
InferHttpInterceptorSchema
Credits
Huge thanks to @diego-aquino for helping!
Full Changelog:
v0.9.5...v0.10.0
onUnhandledRequest(request)
callbacks #480) by @diego-aquino in feat(#zimic): parse unhandled requests (#480) #482This discussion was created from the release v0.10.0.
Beta Was this translation helpful? Give feedback.
All reactions