pass custom validation function with all schema definitions to resources