scribe icon indicating copy to clipboard operation
scribe copied to clipboard

Strategy ResponseCalls running on all endpoints instead of only GET endpoints

Open max13fr opened this issue 1 year ago • 0 comments

Scribe version

4.35

PHP version

8.2.18

Framework

Laravel

Framework version

11.5.0

Scribe config

type => "external_laravel"
theme => "elements"
external.html_attributes.apiDescriptionUrl => "/docs.openapi"
external.html_attributes.basePath => "/docs"
external.html_attributes.layout => "responsive"
external.html_attributes.router => "hash"
external.html_attributes.tryItCredentialsPolicy => "same-origin"
auth.enabled => true
auth.default => true
auth.name => "Authorization"
examples.faker_seed => 666

What happened?

Hello,

Thanks for your awesome package, it's really useful !

I have the default strategies in my configuration for responses :

'strategies' => [
        // ...
        'responses' => [
            Strategies\Responses\UseResponseAttributes::class,
            Strategies\Responses\UseTransformerTags::class,
            Strategies\Responses\UseApiResourceTags::class,
            Strategies\Responses\UseResponseTag::class,
            Strategies\Responses\UseResponseFileTag::class,
            [
                Strategies\Responses\ResponseCalls::class,
                ['only' => ['GET *']]
            ]
        ],
        // ...
],

The ResponseCalls should called only on GET endpoints but it's not the case, it's called on all endpoints, including POST, PUT, DELETE, ...

It's really annoying when it's called on endpoints that can't be rollback (like send mail or something like that).

Thanks in advance, Best regards, Max

Docs

max13fr avatar May 02 '24 14:05 max13fr