Before converting YAML
Format and validate first, inspect the parsed structure, then convert only after deciding how the target format should represent arrays, nested mappings and scalar types.
Syntax is not application validity
A YAML document can parse successfully and still be invalid for Kubernetes, Docker Compose, GitHub Actions, CI/CD, OpenAPI or another application schema.