Skip to content

Custom global headers not applied #1010

@gotexx1

Description

@gotexx1

Scribe version

5.2.1

PHP version

8.3

Laravel version

12.19.3

Scribe config

title => "Lock API"
theme => "elements"
try_it_out.use_csrf => true
auth.enabled => true
auth.default => true
auth.name => "Authorization"
auth.placeholder => "{YOUR_BEARER_TOKEN}"
logo => "build/images/logo.png"
examples.faker_seed => null
strategies.headers => removed [
    'Knuckles\\Scribe\\Extracting\\Strategies\\StaticData',
    [
        'only' => [],
        'except' => [],
        'data' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ],
]
strategies.responses => added [
    'Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls',
    [
        'only' => [
            'GET *',
        ],
        'config' => [
            'app.debug' => false,
        ],
    ],
]: removed [
    'Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls',
    [
        'only' => [
            'GET *',
        ],
        'except' => [],
        'config' => [
            'app.debug' => false,
        ],
        'queryParams' => [],
        'bodyParams' => [],
        'fileParams' => [],
        'cookies' => [],
    ],
]
routeMatcher => "Knuckles\\Scribe\\Matching\\RouteMatcher"

What happened?

When I tried to add the Accept and Content-Type headers as global headers, I found that they were not added to the generated documentation
I try:

  • set theme default and elements
  • php artisan config:cache
  • php artisan scribe:generate

Adding headers is chaotic, sometimes Content-Type is present, sometimes not. The Accept header is never added.

Docs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions