Skip to content

[BUG][csharp-netcore] scheme is forced to http preventing from sending request tp https #14682

@kYann

Description

@kYann

Bug Report Checklist

  • [ x] Have you provided a full/minimal spec to reproduce the issue?
  • [ x] Have you validated the input using an OpenAPI validator (example)?
  • [ x] Have you tested with the latest master to confirm the issue still exists?
  • [ x] Have you searched for related issues/PRs?
  • [ x] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When requesting the API on https after generating it on http it failed.
The issue is that the scheme is hardcoded when it should be taken from the base address.

uriBuilder.Scheme = ClientUtils.SCHEME;
openapi-generator version

6.3.0-20230125.125049-89

OpenAPI declaration file content or url

OpenAPI declaration file content or url
https://gist.github.com/kYann/23eab426be79fd2cb93c2ddb902a8ecd

Generation Details

java -jar ../openapi-generator-cli-6.4.0-20230206.024543-10.jar generate -i http://localhost:5127/swagger/public-v1/swagger.json -c config.yaml

Steps to reproduce
  • Generate client on http endpoint
  • Change url of client to use https
  • Call a query
Suggest a fix

Replace with

uriBuilder.Scheme = HttpClient.BaseAddress!.Scheme;

Thanks,

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