Use the PHP OpenAPI CLI tool
masterThe php-openapi CLI tool allows you to validate OpenAPI 3.0.x files against the official schema and convert between JSON and YAML formats. It supports reading from files or STDIN and writing to files or STDOUT.
# Validate a YAML file
./bin/php-openapi validate input.yaml
# Convert a JSON file to a single YAML file with external references inlined
./bin/php-openapi inline input.json output.yaml