swagger-api/swagger-codegen

Not getting headers in response for android client

Open

#4 281 ouverte le 29 nov. 2016

Voir sur GitHub
 (11 commentaires) (1 réaction) (0 assignés)HTML (5 474 forks)batch import
Client: AndroidEnhancement: FeatureGeneral: Questionhelp wanted

Métriques du dépôt

Stars
 (12 701 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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

Guide contributeur