example for request header
See original GitHub issueIs your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I’m always frustrated when […]
so my API is quite lots of required header for each request. also sometime response have headers too, but this topic is not fit for this thread i guess.
So far I search this repo’s example, n I did found how to make request header, luckily.
/**
*
* POST /board/write
* @summary 게시판 작성 메소드.
* @tags board
* @param {string} x-lang.header.required - ko
* @param {string} x-access-token.header.required - access토큰
* @param {string} x-refresh-token.header.required - refresh토큰
* @param {Req_board_write} request.body.required - song info
* @return {testType} 200 - success response - application/json
* @example request - payload example
* {
* "seqUser" : 0,
* "boardTitle" : "Hello world",
* "boardContext" : "<h1>Hello world</h1>",
* "boardType" : 1
* }
*/
<above image and code is what i did find out so far>
I guess you guys assume that my header’s are might be using all of my restAPI’s. yes, those headers are pretty much everywhere in my project.
and its so hard that I have to copy-paste every single try-out. its so painful.
therefore I expect @example
for request header also.
Describe the solution you’d like A clear and concise description of what you want to happen.
add another annotation tag for request header example eg)
/**
*
* POST /board/write
* @summary 게시판 작성 메소드.
* @tags board
* @param {string} x-lang.header.required - ko
* @param {string} x-access-token.header.required - access토큰
* @param {string} x-refresh-token.header.required - refresh토큰
* @param {Req_board_write} request.body.required - song info
* @return {testType} 200 - success response - application/json
* @example request.body - payload example
* {
* "seqUser" : 0,
* "boardTitle" : "Hello world",
* "boardContext" : "<h1>Hello world</h1>",
* "boardType" : 1
* }
* @example request.header - example headers
* {
* "x-access-token" : "Foo",
* "x-refresh-token" : "Bar",
* "x-lang" : "Faz"
* }
*/
Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.
or extends example for fillable header eg)
/**
*
* POST /board/write
* @summary 게시판 작성 메소드.
* @tags board
* @param {string} x-lang.header.required - ko
* @param {string} x-access-token.header.required - access토큰
* @param {string} x-refresh-token.header.required - refresh토큰
* @param {Req_board_write} request.body.required - song info
* @return {testType} 200 - success response - application/json
* @example request - payload example
* {
* "header" : {
* "x-access-token" : "Foo",
* "x-refresh-token" : "Bar",
* "x-lang" : "Faz"
* }
* "body" : {
* "seqUser" : 0,
* "boardTitle" : "Hello world",
* "boardContext" : "<h1>Hello world</h1>",
* "boardType" : 1
* }
* }
*/
Additional context Add any other context or screenshots about the feature request here. or maybe there is already reqeust header example, i dunno where to find. help me out will ya?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi @juicycool92,
Right now you can add headers for the request like this example as you mentioned in this issue. However, for responses we currently don’t have support for that with the comments but you can use our merge option. Maybe that can help you to solve your issue in the meantime.
For the response headers, there is already an issue and a discussion on the best way to create comments in this issue.
We will keep this issue to track the header’s examples feature progress. I don’t think there is a way to create those examples right now. 🤔 we will have a look. 👍
Thanks for adding the solution to this issue. 🎉