Swagger-php: Header Parameter

Created on 9 Dec 2014  路  8Comments  路  Source: zircote/swagger-php

How about a header parameter?

Most helpful comment

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

All 8 comments

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

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

Strange, maybe the"Accept" is reserved for @SWGConumes and @SWGProduces

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

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

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

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

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",
 *     ),

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?

Was this page helpful?
0 / 5 - 0 ratings