Retrofit2 with RxJava2 should generate Singles, not Observables

Open
#6,895 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Compare the generated service in samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java with the Vert.x example at samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/PetApi.java. Trace the Java Retrofit2 RxJava2 generation template, then regenerate the sample and verify its service methods return RxJava2 Singles rather than Observables.

Written by the indexing model from the issue text.

Description

Right now if i generate for Java with retrofit2 and rxjava2, the output Retrofit service class will generate methods that return Observables. See example here.

However, I think it should generate methods that return RxJava2's Single. It looks like the Java/Vert.X already does this. See example here.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from swagger-api/swagger-codegen

All issues in swagger-api/swagger-codegen

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.