I have an action that returns Unit:
post("/settings") {
blahblahblah...
Unit
}
Previously, the client received an empty response.
But after I upgraded the Scalatra version from 2.5.0 to 2.7.1 and Java from 8 to 11, the response now contains the following text:
object scala.Unit
How can I fix this?

Return the
Unitvalue()instead of theUnitcompanion object (which has typeUnit.typeand is not an instance of typeUnit).In scala 2.13 your code simply would not compile anymore. You get an error: