Skip to content

Usage of dynamic in WebAPI #1434

@xPaw

Description

@xPaw

The API allows doing stuff like this:

dynamic steamNews = WebAPI.GetInterface( "ISteamNews" )
steamNews.GetNewsForApp002( appid: 730, maxlength: 100, count: 5 );

I always found this odd however, but since we can't realistically generate API methods like protobufs, I'm not sure what's a better way of doing things here besides just using the CallAsync which accepts method as string and parameters as args object (which the dynamic object parses into anyway).

One way of fixing this could be creating a source generator which replicates this functionality but without usage of dynamic.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions