readmeio / readmeio/api

Request headers not being set

Open
#836 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area:core bug good first issue help wanted
Dominant language
TypeScript
Stars
697
Forks
31
Avg merge
3d 21h
Merged PRs (30d)
10

Description

After installing my opneapi definitions:

npx api install @hytopia-api-internal/v1.0#1q9bc1r2lorj18va
# or
npx api@next install @hytopia-api-internal/v1.0#1q9bc1r2lorj18va

My TS definitions seem to be generated just fine, this request looks correct on my TS files:

const response = await api.upsertGameReview(
      {
        positive: true,
      },
      {
        gameId: "1234-1234-1234-1234",
        "X-Review-Provider-Key": "SECRET-KEY",
      },
    );

However looking at my API server the X-Review-Provider-Key is not being sent at all, also the X-Authorization header gets ignored as well even though the TS definitions allow it. Making the request through our documentation page in readme.io does work fine though.

Am I doing something wrong or is it a bug?

Edit: I get the same issue generating the SDK with the latest v7 beta branch.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by installing the supplied OpenAPI definition with npx api and calling api.upsertGameReview with X-Review-Provider-Key and X-Authorization. Compare the generated TypeScript SDK request with the working ReadMe documentation request, including the v7 beta output. Done means both headers are sent to the API server when allowed by the definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.