swagger-api/swagger-codegen

swagger-codegen Java client throws PROTOCOL_ERROR when running on Android

Ouverte

#8 526 ouverte le 3 août 2018

 (3 commentaires) (0 réaction) (0 personne assignée)HTML (5 474 forks)batch import
help wanted

Métriques du dépôt

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

Description

Description

When running Java client on Android, it throws PROTOCOL_ERROR - I think it has something to do with Java client using an old version of OkHttp that has HTTP2.0 bugs

Swagger-codegen version

2.3.1

Swagger declaration file content or url

https://api.cloudmersive.com/convert/docs/v1/swagger

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i https://api.cloudmersive.com/convert/docs/v1/swagger -l java --api-package com.cloudmersive.client --model-package com.cloudmersive.client.model --invoker-package com.cloudmersive.client.invoker --group-id com.cloudmersive --artifact-id cloudmersive-java-api-client --artifact-version 1.1.9 -o .

Steps to reproduce

Generate the client using above command

Create a test project in Android Studio

Immediately see the protocol_error:

com.cloudmersive.client.invoker.ApiException: java.io.IOException: stream was reset: PROTOCOL_ERROR

We also tried generating the client with the other library templates but those don't actually compile - pretty frustrating.

Related issues/PRs

https://github.com/square/okhttp/issues/1844

Suggest a fix/enhancement

Change the Java client to use OK HTTP 3.11.0 instead of old 2.75.0 version

Guide contributeur