Skip to content

[Java] Optional Parcelable models for okhttp-gson#3320

Closed
GriffinSchneider wants to merge 2 commits intoswagger-api:masterfrom
GriffinSchneider:parcelable-models
Closed

[Java] Optional Parcelable models for okhttp-gson#3320
GriffinSchneider wants to merge 2 commits intoswagger-api:masterfrom
GriffinSchneider:parcelable-models

Conversation

@GriffinSchneider
Copy link
Copy Markdown
Contributor

As discussed in #3302.

When generating with -l java --library=okhttp-gson -DparcelableModel=true, generated model classes will now implement Android's Parcelable interface.

I essentially just copied how useRxJava works to add the command line option and make the tests pass. Let me know if I should do anything differently and I'll be happy to make the change 👍.

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Jul 20, 2016

@GriffinSchneider thanks for the PR. I did a test and got compile errors. I think you need to update pom.mustache, gradle.build.mustache and sbt.build.mustache to include the dependencies for android.os.Parcelable and android.os.Parcel.

}
return o.toString().replace("\n", "\n ");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add docstrings to the new methods (e.g. writeToParacel, describeContents).

@wing328 wing328 modified the milestones: v2.2.1, v2.3.0 Aug 8, 2016
@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Aug 8, 2016

@GriffinSchneider do you need any help fixing the compilation error?

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Oct 5, 2016

@GriffinSchneider thanks for the PR. Closing this as #3928 has been merged into master.

(the credit will belong to you as the 2 commits are still owned by you)

@wing328 wing328 closed this Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants