Closed gowravshekar closed 6 years ago
case class Request(filePath: String, attributes: CsvAttributes, method: String = "pearson", columns: Seq[String] = Nil, precision: Option[Int] = None) def handle: Handle[Response] = withArgs(arg[Request]("request")) .withMistExtras.onSparkSession((request: Request, extras: MistExtras, sparkSession:SparkSession) => { ... }
Error when submitting the request without method or columns.
method
columns
Bad request: field method:[value is null] Bad request: field columns:[value is null]
Bad request: field method:[value is null]
Bad request: field columns:[value is null]
Missing precision works fine.
precision
I didn't know that possible to obtain default values using shapeless. It seems that we can implement that feature (shapeless defaults)
Done. You could use mist.api.encoding.generic.extractorWithDefaults - docs
mist.api.encoding.generic.extractorWithDefaults
Error when submitting the request without
method
orcolumns
.Bad request: field method:[value is null]
Bad request: field columns:[value is null]
Missing
precision
works fine.