swagger-api/swagger-codegen

Not getting headers in response for android client

Open

#4,281 建立於 2016年11月29日

在 GitHub 查看
 (11 留言) (1 反應) (0 負責人)HTML (5,474 fork)batch import
Client: AndroidEnhancement: FeatureGeneral: Questionhelp wanted

倉庫指標

Star
 (12,701 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Description

I have generated code for android client that uses volley library. I want to get headers from response. How can i get the headers from the response ???

Swagger-codegen version

swagger-codegen-cli-2.2.1.jar

Swagger declaration file content or url
 paths:
   /login:
    post:
      summary: send mobileNum and otp to login
      description: send mobileNum and otp to login
      parameters:
       - name: args
         in: query
         description: send mobileNum and otp in args 
         required: true
         type: string
         format: string
     tags:
       - login
     responses:
       '200':
         headers:
           Authorization:  
             description: access token will be set in the authorization header
             type: string
         description: login successful, received accessToken in header and refreshToken in body
         schema:
           $ref: '#/definitions/ResponseTO'
     ```

 ##### Command line used for generation
java -jar swagger-codegen-cli.jar generate -i login1.yml -l android --library=volley -o login-source-code/ -c config.json

=> for adding header to the request, i can use the following code,
     LoginApi loginApi = new LoginApi();
     loginApi.addHeader(String key, String value)

=> How can i get the headers from the response ??????

貢獻者指南