Zaid-Ajaj / Hawaii

dotnet CLI tool to generate type-safe F# and Fable clients from OpenAPI/Swagger or OData services
MIT License
140 stars 15 forks source link

Header Parameter #35

Closed MichaelMay81 closed 2 years ago

MichaelMay81 commented 2 years ago

I have a range paramter that belongs in the Header. Hawaii recognizes that and creates:

async {
    let requestParts =
        [ ...
          if interval.IsSome then
              RequestPart.query ("interval", interval.Value)
          if range.IsSome then
              RequestPart.header ("range", range.Value)
          if name.IsSome then
              RequestPart.query ("name", name.Value)
          ... ]

    let! (status, content) =
        OpenApiHttp.getAsync url "/repositories/{repository}/timeseries" headers requestParts

but in sendAsync only the parameter extraHeaders is used for Headers. So ranges work if I define them as part headers in the class instance of my client, but not as part of my json attributes.

Suggested solution: Filter Header definitions from parts in sendAsync and merge them with extraHeaders.

Zaid-Ajaj commented 2 years ago

Thanks @MichaelMay81 for opening the issue! I am a bit low on time these days to debug and fix these types of issues. Any chance you could send a PR for it? I will find time tho to review, merge and publish 😉

MichaelMay81 commented 2 years ago

Just trying to get my problem and planned solution to you early, so I am not working on a useless pull request :) But it is done now. Tell me if it is useful :) PullRequest #36

Zaid-Ajaj commented 2 years ago

Resolved as of v0.60 🚀