[GH-ISSUE #4524] [bug]: generated code does not include inherited authorization header #1658

Open
opened 2026-03-16 21:18:21 +03:00 by kerem · 1 comment
Owner

Originally created by @raoulkent on GitHub (Nov 8, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4524

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I generate code snippets for a request that has inherited it's Authorization header, I expect the generated code to include the Authorization header. Instead the generated code snippet lacks an Authorization header alltogether.

I would expect that the generated code matches the request created.

I have created a simple example collection that has been attached as a file.
Pokemon API.json

Steps to reproduce

First step

  1. Import the Pokemon API collection

Happy flow

  1. Set the Authorization Type to Bearer with the value 'foo' for the GET Ditto request
  2. Observe the generated code under Generated Code>Shell - cURL (see generated code below)
curl --request GET \
  --url https://pokeapi.co/api/v2/pokemon/ditto \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer foo' \
  --header 'content-type: application/json'

Sad flow

  1. Set the Authorization Type to inherit for the GET Ditto request
  2. Set the Authorization Type to Bearer with the value 'foo' for the Pokemon API collection
  3. Observe the generated code under Generated Code>Shell - cURL (see generated code below)
curl --request GET \
  --url https://pokeapi.co/api/v2/pokemon/ditto \
  --header 'Accept: application/json' \
  --header 'content-type: application/json'

Thus we can see that the generated code is now missing the correct Authorization header.

Environment

Production

Version

Self-hosted

Originally created by @raoulkent on GitHub (Nov 8, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4524 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When I generate code snippets for a request that has inherited it's `Authorization` header, I expect the generated code to include the `Authorization` header. Instead the generated code snippet lacks an `Authorization` header alltogether. I would expect that the generated code matches the request created. I have created a simple example collection that has been attached as a file. [Pokemon API.json](https://github.com/user-attachments/files/17678926/Pokemon.API.json) ### Steps to reproduce ## First step 1. Import the Pokemon API collection ## Happy flow 2. Set the `Authorization Type` to `Bearer` with the value 'foo' for the `GET Ditto` request 3. Observe the generated code under Generated Code>Shell - cURL (see generated code below) ```shell curl --request GET \ --url https://pokeapi.co/api/v2/pokemon/ditto \ --header 'Accept: application/json' \ --header 'Authorization: Bearer foo' \ --header 'content-type: application/json' ``` ## Sad flow 4. Set the `Authorization Type` to `inherit` for the `GET Ditto` request 5. Set the `Authorization Type` to `Bearer` with the value 'foo' for the `Pokemon API` collection 6. Observe the generated code under Generated Code>Shell - cURL (see generated code below) ```shell curl --request GET \ --url https://pokeapi.co/api/v2/pokemon/ditto \ --header 'Accept: application/json' \ --header 'content-type: application/json' ``` Thus we can see that the generated code is now missing the correct `Authorization` header. ### Environment Production ### Version Self-hosted
Author
Owner

@nair-sreerag commented on GitHub (Nov 8, 2024):

Hi can I take this up if this is still open and no one is working on it?

<!-- gh-comment-id:2465073755 --> @nair-sreerag commented on GitHub (Nov 8, 2024): Hi can I take this up if this is still open and no one is working on it?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1658
No description provided.