Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #6800
Closed
Open
Issue created Jun 28, 2020 by Administrator@rootContributor

[REQ] New C# Generator that uses HttpClient instead of RestSharp

Created by: hannahchan

The existing C# generators produce clients that rely on the RestSharp library instead of the built-in System.Net.Http.HttpClient. This is particularly annoying if you're building apps using the ASP.NET Typed HttpClient pattern. In addition because the generated clients don't use System.Net.Http.HttpClient, it's impossible (or not very obvious) where you would add delegating handlers to handle cross-cutting concerns that span across all requests. Examples of cross-cutting concerns might be request logging, trace header propagation and retry logic.

What I would like to see is an alternative C# generator that would generate code to support developers in using the Typed HttpClient pattern.

For information about the System.Net.Http.HttpClient API. https://docs.microsoft.com/dotnet/api/system.net.http.httpclient

For information about making requests with System.Net.Http.HttpClient. https://docs.microsoft.com/aspnet/core/fundamentals/http-requests

For a quick guide to System.Net.Http.HttpClient and Delegating Handlers, I highly recommend the first half of this talk. https://youtu.be/ojDxK_-I-To

Assignee
Assign to
Time tracking