Closed hohonuuli closed 8 months ago
I adde the following to help drop nulls/None from the generated JSON:
extension [T: Encoder](value: T) def stringify: String = Encoder[T].apply(value)
.deepDropNullValues
.stringify
In order to get null
s dropped from the JSON output, I did the following:
CirceCodecs.scala
:val CustomPrinter: Printer = Printer(
dropNullValues = true,
indent = ""
)
TapirJsonCirce
. I did this in Endpoints.scala
object CustomTapirJsonCirce extends TapirJsonCirce:
override def jsonPrinter: Printer = CirceCodecs.CustomPrinter
In each endpoints class, comment out tapir's default implementation and import my custom one
//import sttp.tapir.json.circe.*
import CustomTapirJsonCirce.*
Probably the best way to do this is to add integration tests to mbari-org/vars-annotation as a starting point
See mbari-org/vars-annotation#169
There are some minor changes, but I've updated the next (pending) release of vars-annotation to handle them. I will have to coordinate with @kevinsbarnard to run tests with vars-gridview.