How to convert an openapi yaml specification to json
- Step 1Open the OpenAPI YAML file — Copy the contents of your openapi.yaml or swagger.yaml file. Multi-file specs with $ref to external files need to be bundled into a single file first using a tool like swagger-cli bundle.
- Step 2Paste and convert to JSON — Paste the YAML and click Convert. YAML anchors for reusable schemas are resolved and the output is a single self-contained JSON object starting with openapi: '3.0.0' or swagger: '2.0'.
- Step 3Import into Postman or a code generator — Save the JSON as openapi.json. Import it into Postman via File →’ Import →’ OpenAPI, or pass it to openapi-generator-cli generate -i openapi.json -g typescript-axios -o ./src/api.
- Step 4Validate the converted JSON — Paste the JSON into the JSON Validator tool or run it through an OpenAPI validator like Spectral to confirm no schema references were broken during conversion.
Frequently asked questions
What happens to $ref references pointing to external files?+
External $ref values like $ref: './schemas/user.yaml' are preserved as-is in the JSON output — they are not resolved. Bundle all referenced files into a single spec first using swagger-cli bundle or @redocly/cli bundle before converting to JSON.
Will the JSON output work directly with AWS API Gateway import?+
AWS API Gateway import accepts OpenAPI 3.0 JSON. After converting, validate the spec against AWS's supported extensions and remove any unsupported x- fields. AWS has specific requirements for x-amazon-apigateway-* extensions that need to be added separately.
Is the API specification — including internal endpoint paths — transmitted to JAD Apps?+
No. Conversion runs entirely in your browser using js-yaml. Internal API endpoint paths, authentication configuration, and proprietary data schemas are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.