Skip to content

Remove dynamic WebAPI interfaces - #1652

Open
xPaw wants to merge 1 commit into
masterfrom
remove-dynamic
Open

xPaw wants to merge 1 commit into
masterfrom
remove-dynamic

Conversation

@xPaw

@xPaw xPaw commented Oct 25, 2026

Copy link
Copy Markdown
Member

Remove dynamic WebAPI interfaces

Closes #1434.

WebAPI.Interface and WebAPI.AsyncInterface no longer derive from DynamicObject. Use Call / CallAsync / CallProtobufAsync. Factories are unchanged.

List arguments are now flattened to name[0], name[1]… by the typed calls too (previously dynamic only).

If #1651 lands first, this PR will also drop the DynamicObject IL3050 suppressions and re-enable PublishAot for sample 021.

Breaking changes

Calls through dynamic still compile but throw RuntimeBinderException at runtime.

// before
dynamic iface = WebAPI.GetInterface( "ISteamNews" );
KeyValue news = iface.GetNewsForApp2( appid: 440, method: HttpMethod.Post );

// after
var iface = WebAPI.GetAsyncInterface( "ISteamNews" );
KeyValue news = await iface.CallAsync( HttpMethod.Post, "GetNewsForApp", 2, new() { [ "appid" ] = 440 } );

The version suffix becomes the version argument, and method: becomes the first argument.

Usage

About 31 of SteamKit's 918 GitHub dependents call through dynamic, mostly stale SteamBot forks and small bots. Nearly all pin SteamKit2 1.x or 2.x; only two are on 3.x. Projects that already use CallAsync, such as ArchiSteamFarm, are unaffected.

@xPaw
xPaw requested a review from voided October 25, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage of dynamic in WebAPI

1 participant