Fixes T868
Ralph wanted to be able to require ref_url in the Result. Doing this,
I discovered that even though we have some fields marked as required,
the engine does not really provide an option to set, that the field must
be both specified, and non-empty, thus leading to some situations, that
I thought are covered by marking stuff as 'required' like a Result's testcase
where the 'required' condition would be satisfied by an empty dict,
and that is not semantically right.
So this patch does two things, in the end
- it makes sure, that 'required' fields are also checked for 'non-emptiness'
- adds config options for specifying which (additional) fields are to be required
Ad the config part - the config now has a new option REQUIRED_DATA (dict).
This can be used to specify field, that are to be marked as required for the
request parser instace specified by the dict's key (e.g. create_result).
The value of that key is a list of strings, where the string is the name of
the field, which is to be set as required (e.g. create_group: ['description'])
These fields are _in addition_ to the fields that are already required,
so there is no way to say, that outcome is now not required for Result.
As Results are a specific beast, the fields-to-be-required can be also
specified in the data.{NAME} format, to enforce data in the 'additional
fields' - e.g. to require an arch value, you could set
create_result: ['data.arch']. This only works for create_result as
it is the only place where the fields can be 'generic'.