staging-client-java
staging-client-java copied to clipboard
Should default output be included for invalid input?
There are times when there is enough input to calculate a schema, however we don't process anything in staging because the inputs are not valid. The question is should the library return the outputs with default values in that case?
For example, EOD input that looks like this:
{
"site": "C713",
"hist": "8020",
"behavior": "3",
"eod_primary_tumor": "200",
"eod_regional_nodes": "300",
"eod_mets": "00",
"year_dx": "2018"
}
returns the following:
{
"result": "FAILED_INVALID_INPUT",
"schema_id": "brain",
"input": {
"site": "C713",
"hist": "8020",
"behavior": "3",
"eod_primary_tumor": "200",
"eod_regional_nodes": "300",
"eod_mets": "00",
"year_dx": "2018"
},
"errors": [
{
"type": "INVALID_REQUIRED_INPUT",
"table": "extension_bcc",
"key": "eod_primary_tumor",
"message": "Invalid 'eod_primary_tumor' value (200)"
},
{
"type": "INVALID_REQUIRED_INPUT",
"table": "nodes_dna",
"key": "eod_regional_nodes",
"message": "Invalid 'eod_regional_nodes' value (300)"
}
]
}
There is no output. However the brain schema does have default output values that could be returned.

Should they be returned?