Skip to content

Custom Headers #299

Answered by mojtabasoori
masitings asked this question in Q&A
Jan 22, 2024 · 2 comments · 8 replies
Discussion options

You must be logged in to vote

hi,

i add custom header with extension.

use Dedoc\Scramble\Support\RouteInfo;
use Dedoc\Scramble\Support\Generator\Schema;
use Dedoc\Scramble\Support\Generator\Operation;
use Dedoc\Scramble\Support\Generator\Parameter;
use Dedoc\Scramble\Extensions\OperationExtension;
use Dedoc\Scramble\Support\Generator\Types\StringType;

class AddCustomHeader  extends OperationExtension
{
    public function handle(Operation $operation, RouteInfo $routeInfo)
    {
        $operation->addParameters([
            Parameter::make('X-custom-id', 'header')
                ->setSchema(
                    Schema::fromType(new StringType())
                )
                ->required(true)
                ->e…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by masitings
Comment options

You must be logged in to vote
8 replies
@romalytvynenko
Comment options

@romalytvynenko
Comment options

@hondamitrajayarayi
Comment options

@romalytvynenko
Comment options

@hondamitrajayarayi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants