swagger-api / swagger-api/swagger-codegen

[Java/Android] Parcelable models?

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

Nobody has claimed this yet.

Client: Android Client: Java Enhancement: Feature help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

As recommended by the faq here, I'm using swagger-codegen to generate and Android library with -l java --library=okhttp-gson.

It's very helpful to have swagger-codegen's generated models implement Android's Parcelable interface, so that they can be added to Intents, passed between Activitys, saved to disk, etc.

The changes needed to make models Parcelable are pretty simple, at least for my specific use case. You can see my implementation here: https://github.com/GriffinSchneider/swagger-codegen/commit/9673d4d7c7d4c5f3df1ddc5e6367457f1c3eb455

So,

  • Are Parcelable models something that you'd want to merge? I'd be happy to make whatever changes are needed.
  • If so, what do I need to do to get my branch to a mergeable state? Should Parcelable models be a command line option somehow? Do I need to add support for cases other than -l java --library=okhttp-gson? I see that -l Android exists, but the Wiki recommends that I don't use it, should I do something there?

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.

Research direction

Start by reviewing the linked implementation and the generation path for -l java --library=okhttp-gson, then compare it with the existing -l Android option. Determine how Parcelable model generation should be selected and whether other Java libraries need support. Done means an agreed scope and mergeable implementation with coverage for the supported generation paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.