Skip to content

Remove deprecated ParserSettings.apply/create (since Akka HTTP 10.2.0)#1126

Merged
He-Pin merged 7 commits into
apache:mainfrom
He-Pin:remove/deprecated-parser-settings
Jul 5, 2026
Merged

Remove deprecated ParserSettings.apply/create (since Akka HTTP 10.2.0)#1126
He-Pin merged 7 commits into
apache:mainfrom
He-Pin:remove/deprecated-parser-settings

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 5, 2026

Copy link
Copy Markdown
Member

Motivation

ParserSettings.apply and ParserSettings.create were deprecated since Akka HTTP 10.2.0 in favor of forServer and forClient.

Modification

Removed deprecated apply methods from Scala API and create methods from Java API. Updated test to use forServer(). Added MiMa filters.

Result

Deprecated API removed. Users should use ParserSettings.forServer() or ParserSettings.forClient().

He-Pin added 6 commits July 5, 2026 11:38
SettingsCompanion requires apply/create(config: Config) and
apply/create(configOverrides: String) which were removed as deprecated.
Replace with direct apply/create methods delegating to forServer.
Motivation:
ParserSettings no longer extends SettingsCompanion, so the
apply(config: Config) method is no longer available.

Modification:
Replace ParserSettings(config) with ParserSettings.forServer,
which uses the implicit ActorSystem. Remove unused @nowarn
annotation and import.

Result:
Test compiles and runs correctly with the updated ParserSettings API.
…on removal

Motivation:
ParserSettings no longer extends SettingsCompanion, so
ParserSettings(system) now creates server-specific settings (via forServer).
Two tests relied on the old generic behavior. MiMa also reports
IncompatibleMethTypeProblem, IncompatibleResultTypeProblem, and
MissingTypesProblem from the SettingsCompanion removal.

Modification:
- ServerSettingsSpec: use ParserSettings.forClient to get client-specific
  settings that correctly fail when used with ServerSettings
- ClientConnectionSettingsSpec: use ParserSettings.forServer explicitly
- Add MiMa filters for ParserSettings$ type changes

Result:
Tests pass with the updated ParserSettings API and MiMa checks succeed.
Motivation:
With SettingsCompanion removed from ParserSettings, there is no
longer a way to create 'generic' (non-scoped) parser settings.
The tests that verified early failure when using generic settings
with scoped settings objects are no longer applicable.

Modification:
Remove the 'fail early' tests from ClientConnectionSettingsSpec
and ServerSettingsSpec. Both forServer and forClient produce
complete settings with max-content-length defined.

Result:
Remaining tests pass without the inapplicable scenario.
@He-Pin He-Pin marked this pull request as ready for review July 5, 2026 04:56

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin He-Pin merged commit fad7678 into apache:main Jul 5, 2026
5 checks passed
@He-Pin He-Pin deleted the remove/deprecated-parser-settings branch July 5, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants