swagger-api/swagger-codegen

Not getting headers in response for android client

開放

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

 (11 則留言) (1 個反應) (0 位負責人)HTML (5,474 個分叉)batch import
Client: AndroidEnhancement: FeatureGeneral: Questionhelp wanted

倉庫指標

星標
 (12,701 顆星)
PR 合併指標
 (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 ??????


貢獻者指南