diff --git a/src/core/input_descriptor.rs b/src/core/input_descriptor.rs index 0d7c91a..f404d4c 100644 --- a/src/core/input_descriptor.rs +++ b/src/core/input_descriptor.rs @@ -127,6 +127,15 @@ impl InputDescriptor { .fields .iter() .map(|field| field.requested_fields(self.id.clone(), value)) + .map(|mut requested_field| { + // Set the purpose of the requested field to the input descriptor `purpose`, + // if it is no value is set from the constraint field's `purpose`. + if requested_field.purpose.is_none() { + requested_field.purpose = self.purpose.clone(); + } + + requested_field + }) .collect() }