v0.6.0
Added
RequestBuilder::disable_validation(featureschema-validate) — per-request skip of registry JSON Schema validation (request body, query, params, and response onsend()orStreamingResponse::collect()). Matches TypeScriptdisableValidation. Strictensure_routeis unchanged. Garde (validatefeature) is separate — usevalidate_response(false)onsend_json_validated. Also onEndpointRequestBuilder.ClientBuilder::wire_concurrency_limit— declare the TowerConcurrencyLimitLayerlimit sobuild()can warn when it matchesmax_in_flight.- Concurrency build warnings —
tracing::warn!whenmax_in_flightis combined with a custom transport stack (backend,http_service,transport_stack, etc.), with a sharper message when client and wire limits are equal. - Cargo feature
sse—SseDecoder,parse_sse_events,StreamingResponse::sse_events/read_sse_events(included infull). Core streaming (send_stream,collect, etc.) is unchanged without this feature. - Edge-case integration tests — non-replayable upload streams on retry;
throw_on_errorwith large streaming bodies (peek vs drain /BodyTooLarge); plugininitvs hook order; path/query URL regressions; Tower buffered vs streamingtransport_stack; cancellation mid-collect()and during retry. See testing — edge-case matrix.
Changed
- Breaking: SSE helpers are no longer built by default. Enable
features = ["sse"]if you use.sse_events(),.read_sse_events(), orbetter_fetch::sse::*(they were always available in 0.5.0 without a separate feature flag). request_pipeline— internal refactor only: shared stream body wrapping, peek limit helper, and transport-error handling in the HTTP loop (no public API change).
Migration (0.5.x → 0.6.0)
# Default features unchanged; add "sse" if you use SSE helpers.
better-fetch = { version = "0.6", features = ["json", "sse"] }
# Optional: declare Tower wire limit for build-time concurrency diagnostics.
# .wire_concurrency_limit(32) # when using ConcurrencyLimitLayer::new(32) on transport_stackIf you use strict JSON Schema validation and need to skip it for one call (e.g. debugging or gradual rollout), use .disable_validation(true) on that request instead of turning off strict mode on the whole registry.