We had a working application that was running on 8.7 and we had recently upgraded that to 8.8. The application had a custom entity that had a 'file' field and the file system was private. The file upload field started showing
"This value should be of the correct primitive type"
error whenever you upload any file. This was working correctly before the 8.8 upgrade.
I am reporting this issue so that this gets documented somewhere. I figured out the reason why this was failing and I believe that the failure itself might be as per design. The error message was a bit too cryptic to understand though. There is a related issue reported around this - #2012690: 'type' constraints generate crappy error messages.
The issue was because the file_directory property had a colon in the directory name that was causing parse_url to fail inside PrimitiveTypeConstraintValidator class. Even though the application was able to create directories and store private files (directory paths never become part of urls) the ':' itself is not valid part of the URL. Changed the file_directory property and the error stopped.
Hope this helps somebody.