Add future: true as a Savon 3.0 preview channel - #1061
Open
rubiii wants to merge 5 commits into
Open
Conversation
An opt-in global that applies the next major's defaults today. Currently that is Nori's new `:standards` and `:serializable` profiles plus Savon's new `transport: :faraday`. Explicitly set options keep winning. Requires nori ~> 2.9.
@options now holds only caller-set values. defaults and the future overlay are separate layers resolved on every read. removes the explicit-option tracking.
client.globals freezes once the client is created. post client-creation writes raise a FrozenError. Mutation after init skips validation, WSDL setup and causes other problems like not being thread-safe.
With the flag in its `client(...)` configuration, Model now records options, later `.global` calls included, and creates the client once on first use. Without the flag, Model behavior is unchanged.
client.globals.dup shared the internal storage with the original, so writing to the copy silently reconfigured the client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change is this?
A feature plus two small bugfixes found along the way.
Did you add tests for your changes?
Yes. New specs covering the flag, each previewed default, option precedence, and the frozen-options contract.
Summary of changes
Savon 2.x stays strictly safe to upgrade to. This change adds a way for us to introduce new behavior we see in the next major version as an opt-in feature.
It's the one documented exception to the safe-to-upgrade rule and every option you set explicitly still wins over a future default.
The client logs one info-level line at creation stating this contract (silenced at log_level: :warn or higher).
What the flag previews in this release:
Spec-correct parsing. Empty tags become "" not nil, xml:space="preserve" whitespace is kept, and no types are guessed without a schema.
Plain, serializable response data (no custom value classes), so attributes survive to_json.
The Faraday transport (from 2.17.0) becomes the default. HTTPI-specific globals are rejected with a per-option migration hint.
client.globals is frozen after creation. Mutating it afterwards raises a FrozenError. Savon::Model adapts by recording config and building the client once on first use.
The preview grows with 2.x minor releases. Changes are tracked in the changelog's "3.0 preview" section and announced in discussion #1060 (#1060).
Two bugfixes included:
Other information
Bumps the minimum Nori to ~> 2.9 (needed for the standards/serializable profiles).
Default behavior without the flag is unchanged.
Discussion: #1060.