swagger-api/swagger-codegen

Not getting headers in response for android client

Open

#4,281 opened on Nov 29, 2016

View on GitHub
 (11 comments) (1 reaction) (0 assignees)HTML (12,701 stars) (5,474 forks)batch import
Client: AndroidEnhancement: FeatureGeneral: Questionhelp wanted

Description

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 ??????

Contributor guide

Not getting headers in response for android client · swagger-api/swagger-codegen#4281 | Good First Issue