hubverse-org / hubValidations

Testing framework for hubverse hub validations
https://hubverse-org.github.io/hubValidations/
Other
1 stars 4 forks source link

Use `is_required` to determine required values in `expand_model_out_grid()` v4 output type #159

Closed annakrystalli closed 1 week ago

annakrystalli commented 2 weeks ago

Also, need to handle the fact whether an output type is required or not is now handled by is_required but if an optional output_type is submitted, all output_type_ids must be present.

Originally posted by @annakrystalli in https://github.com/hubverse-org/hubValidations/issues/156#issuecomment-2467679059

One current problem arises from the fact that for v4, all output_type_id values are stored under required even if the output type is not required. I fnot changed, all output_type_id values will end up as required. One thing that could be done, to maintain back-compatibility too, is to build on the current system in the back-end and shift required values to an optional property.

An additional complication, however, arises from the fact that, when an optional output type is having data submitted to, all output_type_ids should now be considered required, so no need to shift. This requires knowledge of output types in the data, something that expand_model_out_grid() has not required up to now. Need a simple and none invasive method of being able to indicated output_types that might be optional but their output type IDs must be included in the required_only output.