Skip to content

[Kotlin] Add polymorphic support for Gson #7164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

loicsiret
Copy link

@loicsiret loicsiret commented Aug 7, 2020

Based on Java-Gson generator

Modify the templates files of Serializer for supporting Polymorphic in Kotlin - GSON
This is a port of the [java template]

You can check against this yaml file to validate : generic.yaml

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

FIXED #7163

cc: @jimschubert , @dr4ke616 @karismann @Zomzog @andrewemery @4brunu @yutaka0m

Siret, Loic added 2 commits August 7, 2020 15:58
@auto-labeler
Copy link

auto-labeler bot commented Aug 7, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@loicsiret loicsiret marked this pull request as ready for review August 7, 2020 20:57
@loicsiret
Copy link
Author

Hum, is this related to my change ?

download failed: org.scala-sbt#compiler-ivy-integration;0.13.16!compiler-ivy-integration.jar Error during sbt execution: Error retrieving required libraries (see /home/circleci/.sbt/boot/update.log for complete log) Error: Could not retrieve sbt 0.13.16 [ERROR] Command execution failed.

@4brunu
Copy link
Contributor

4brunu commented Aug 10, 2020

Could this change have a flag to enable or disable this behaviour?

@loicsiret
Copy link
Author

I think it shouldn't, unless you have a specific use case ?
Other languages (at my knowledge) didn't require to specify explicitly the polymorphic support. As a user, I expect the generator to be able to deserialise polymorphic list out of the box. The only thing may be to remove Gsonfire if no polymorphic support is needed.

@4brunu
Copy link
Contributor

4brunu commented Aug 10, 2020

Remove Gsonfire if no polymorphic support is needed does what I need, looks a good solution to me 👍

@4brunu
Copy link
Contributor

4brunu commented May 26, 2021

@loicsiret I was going through the old PRs and saw this one.
Are you still interested in this functionality?

@loicsiret
Copy link
Author

loicsiret commented May 26, 2021 via email

@4brunu
Copy link
Contributor

4brunu commented May 26, 2021

Thanks for the heads-up 🙂

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.

[REQ] [Kotlin] Add Polymorphic support for Kotlin with GSON
3 participants