We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
One possibility for a fix is to check for the discriminator, for example change
implicit def jsonReadsBillingExternalEventTransactionDeleted: play.api.libs.json.Reads[TransactionDeleted] = { for { eventId <- (__ \ "event_id").read[String] timestamp <- (__ \ "timestamp").read[_root_.org.joda.time.DateTime] organization <- (__ \ "organization").read[String] transaction <- (__ \ "transaction").read[io.flow.billing.v0.models.Transaction] } yield TransactionDeleted(eventId, timestamp, organization, transaction) }
to
implicit def jsonReadsBillingExternalEventTransactionDeleted: play.api.libs.json.Reads[TransactionDeleted] = { for { discriminator <- (__ \ "discriminator").read[String] eventId <- (__ \ "event_id").read[String] timestamp <- (__ \ "timestamp").read[_root_.org.joda.time.DateTime] organization <- (__ \ "organization").read[String] transaction <- (__ \ "transaction").read[io.flow.billing.v0.models.Transaction] } yield if (discriminator == "transaction_deleted") TransactionDeleted(eventId, timestamp, organization, transaction) else sys.error(s"Invalid discriminator: $discriminator") // possibly JsError instead? }
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: