swagger-php icon indicating copy to clipboard operation
swagger-php copied to clipboard

Header Parameter

Open adammbalogh opened this issue 11 years ago • 8 comments

How about a header parameter?

adammbalogh avatar Dec 09 '14 16:12 adammbalogh

Use @SWG\Parameter(paramType="header", ...)

bfanger avatar Dec 09 '14 17:12 bfanger

Thanks. Anyway there is an interesting issue. It does not able to send the head if it is "Accept", but "accept" works.

adammbalogh avatar Dec 09 '14 20:12 adammbalogh

Strange, maybe the"Accept" is reserved for @SWG\Conumes and @SWG\Produces

@SWG\Resource(
    ... ,
    produces="['application/json','application/xml']"
)

bfanger avatar Dec 10 '14 17:12 bfanger

Nevermind.

Anyway, the docs should contain the header and the form type too in the Parameter sections. Now it looks like this: paramType body|query|path

adammbalogh avatar Dec 10 '14 19:12 adammbalogh

swagger-php 2.x @SWG\Parameter(in="header") which is beter documented.

bfanger avatar Apr 17 '15 16:04 bfanger

How can I define header in Definition? I want to pass headers in all APIs and want a common Definition which can be called from Definition directly

anishTPM avatar Mar 23 '17 06:03 anishTPM

For whom is new here, it changed. Use it with in="header"

 *     @SWG\Parameter(
 *         name="x-id",
 *         in="header",
 *         description="ID",
 *         required=true,
 *         type="string",
 *     ),

matheushf avatar Apr 08 '18 12:04 matheushf

How can I define header in Definition? I want to pass headers in all APIs and want a common Definition which can be called from Definition directly

have u solve this problem?

naffan2014 avatar Sep 12 '18 03:09 naffan2014