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

Inline/Value class property name included in header #16

Open
dellisd opened this issue May 17, 2022 · 0 comments
Open

Inline/Value class property name included in header #16

dellisd opened this issue May 17, 2022 · 0 comments

Comments

@dellisd
Copy link

dellisd commented May 17, 2022

Given a value class, and some data class to represent the CSV contents:

@JvmInline
@Serializable
value class MyId(val value: String)

@Serializable
data class Entry(
  @SerialName("my_id") val id: MyId,
  @SerialName("my_content") val content: String,
)

this will correctly decode the following CSV

my_id, my_content
A, A Test
B, B Test

but when serializing a list of Entry objects, the column name for Entry.id includes the value property from the MyId class.

my_id.value, my_content
A, A Test
B, B Test

The value/inline class's property should be serialized directly without the hierarchical property name.

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

No branches or pull requests

1 participant