-
Notifications
You must be signed in to change notification settings - Fork 35
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
Excluding type tag from json #77
Comments
How would you deserialize such JSON blobs? I mean, how would you detect which concrete class, |
One way to disable it is to have distinct formats, one format for |
I can relate to this issue. You could have another def default(): TypeTagOWrites =
new TypeTagOWrites {
def owrites[A](typeName: String, owrites: OWrites[A]): OWrites[A] =
OWrites[A](a => owrites.writes(a))
} In my case, I want to have all my case classes with different parameters written with one implicit. I do not want to have multiple implicits. However, I want to also add other fields from my sealed trait. I want that to be done in a specific order and different than provided with the "flat" implicit. I want other fields between my "typeName" and the I tested it locally and it works. I can provide the code. |
Unless there is a different solution provided with your library that I am unable to see. |
Is there a way to exclude the discriminator type tag from the output json.
For example
the output json should be
lets say for Bar
i.e. It should not include "_type": "Bar" in the json.
I found following are the ways to customise the type tag
Is there a way to disable it ?
The text was updated successfully, but these errors were encountered: