Currently the '_schema' is appended only if the name of the key contains '.json' or '.csv'.
The uploaded file is always a son based on your code.
And the scheme itself is always a son.
I think if the key has an extension, you need to remove it, and append the '_schema.json'.