Skip to content

Add future: true as a Savon 3.0 preview channel - #1061

Open
rubiii wants to merge 5 commits into
mainfrom
future-option
Open

Add future: true as a Savon 3.0 preview channel#1061
rubiii wants to merge 5 commits into
mainfrom
future-option

Conversation

@rubiii

@rubiii rubiii commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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.

client = Savon.client(wsdl: "...", future: true)

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:

  • Nori standards: true
    Spec-correct parsing. Empty tags become "" not nil, xml:space="preserve" whitespace is kept, and no types are guessed without a schema.
  • Nori serializable: true
    Plain, serializable response data (no custom value classes), so attributes survive to_json.
  • transport: :faraday
    The Faraday transport (from 2.17.0) becomes the default. HTTPI-specific globals are rejected with a per-option migration hint.
  • Frozen client options
    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:

  • globals.dup no longer shares storage with the original client.
  • Faraday clients no longer stamp HTTPI's global logging config (when HTTPI is not even involded).

Other information

Bumps the minimum Nori to ~> 2.9 (needed for the standards/serializable profiles).
Default behavior without the flag is unchanged.
Discussion: #1060.

rubiii added 5 commits July 5, 2026 15:16
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant