Azure / azure-rest-api-specs-tests

Live Testing for Azure REST API Specifications
MIT License
2 stars 5 forks source link

Generic client implementation for HTTP and JSON-RPC #21

Closed sergey-shandar closed 7 years ago

sergey-shandar commented 7 years ago

Currently, we have two AutoRest generators. One is for HTTP (Azure.CSharp) and another on for JSON-RPC (Azure.JsonRpcClient). It's possible to have only one if we generate calls to one generic functions. Something like

class Parameter
{
    public string Name;

    public object Value;

    // additional fields for HTTP 
}

class Request
{
    public string OperationId { get; }

    public Parameter[] Parameters { get; }

    // additional fields for HTTP 
}

interface IGenericClient
{
    Task<T> SendAsync<T>(Request request);
}
sergey-shandar commented 7 years ago

https://github.com/Azure/azure-rest-api-specs-tests/pull/29