Importing an OpenAPI Spec
Last updated 2026-03-10
Supported Formats
CodeContext supports OpenAPI 3.0 and 3.1 specifications in both JSON and YAML formats. If your spec uses an older Swagger 2.0 format, you will need to convert it to OpenAPI 3.x before importing. There are free online tools that can handle this conversion for you.
How to Import
To import an API spec, navigate to the API Specs page in your dashboard and click "Import Spec." You have two options:
- Upload a file — Select a JSON or YAML file from your computer.
- Paste a URL — Enter a public URL where your spec is hosted, and CodeContext will fetch it for you.
After selecting your source, give your spec a name and click "Import." CodeContext will parse the specification, extract all endpoints, schemas, and descriptions, and make them browsable in your dashboard.
Reviewing Your Import
Once the import is complete, you will see a summary page showing:
- The number of endpoints found.
- The number of schemas and models extracted.
- Any warnings about missing descriptions or incomplete definitions.
Take a moment to review the imported data and make sure everything looks correct.
Troubleshooting Imports
If your import fails, here are some common causes:
- Invalid spec format — Make sure your file is valid JSON or YAML and follows the OpenAPI 3.x structure.
- Missing required fields — The spec must include an
infoobject with atitleandversion. - File too large — Specs over 10 MB may fail. Try removing unused schemas or splitting into multiple specs.
Related Articles
Still need help?
Our support team is happy to help with any questions you may have.
support@codecontext.app