Skip to content
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

Add support to use inner traits as inputs/outputs properly #286

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

andresgomezfrr
Copy link
Collaborator

TL;DR

Fix the usage of inner traits properly, before this fix the usage of fromLiteralMap of an inner trait we result in a case class with a Map[String, Any] instead of rebuilding the proper case class extending of the trait.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

This fix stores the type of the Product inside the struct using an internal field __type. This is used inside the mapToProduct to rebuild the product class if is not possible to extract the product type from the scala type. For example, if you are using a trait inside the case class, it doesn't match with a Product, because the scala type is the trait so it is not possible to rebuild the proper case class, in this case, you can use this type inside the __type field to rebuild the proper product class.

Signed-off-by: Andres Gomez Ferrer <[email protected]>
@RRap0so RRap0so merged commit 9d36689 into master Apr 2, 2024
4 checks passed
@RRap0so RRap0so deleted the add-support-to-inner-traits branch April 2, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants