in case you need the keys when using kubectl combined with jsonpath=, a workaround could be to have jq filter the keys only.
kubectl get secret my_secret --no-headers -o jsonpath='{.data}' | jq 'keys'