Custom resource objects using custom resources like Spark on K8s operator

If I want to use API to create Custom objects (spark jobs) based on crd based operator like spark on k8s operator - SparkApplication do I use - https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CustomObjectsApi.md?

Also this api uses json instead of yaml, while in the doc kubectl apply -f <someSparkApplication.yaml> they are using YAML. Is it a problem?