spray / spray-json

A lightweight, clean and simple JSON implementation in Scala
Apache License 2.0
969 stars 190 forks source link

Move out OptionFormat from StandardFormats to allow mix with custom implicits modules #348

Open domartynov opened 2 years ago

domartynov commented 2 years ago

To fix an issue with a custom implicits module due to OptionFormat being an inner class of StandardFormats breaking the match in ProductFormats.productElement2Field when custom module implicits are used: https://github.com/spray/spray-json/blob/a2b4986d17f8cc9c9080ecf46af8f69dc72be1d5/src/main/scala/spray/json/ProductFormats.scala#L46

Changes include a test case that reproduces the issue.

The patch is my original work and I license the work to the spray-json project under the project’s open source license.