Use Routes::getRouteName() instead of hardcoding 'jsonapi.file--file.individual'.
Use Routes::getRouteName() instead of hardcoding 'jsonapi.file--file.individual' in case 'file--file' has been aliased.
Use Routes::getRouteName() instead of hardcoding 'jsonapi.file--file.individual' in case 'file--file' has been aliased.