Verify the file format
Make sure your specification:- Is in JSON or YAML
- Uses a
.json,.yaml, or.ymlextension - Is 10 MB or smaller
Verify the OpenAPI version
Your document must contain one of the following top-level fields:openapifor OpenAPI 3.xswaggerfor Swagger 2.0
Check for syntax errors
Invalid syntax is one of the most common causes of failed imports. Verify that:- JSON is well-formed
- YAML indentation is consistent
- Brackets, braces, and quotation marks are balanced
Review your operations
For the best import experience:- Give every operation a unique
operationId - Write clear summaries and descriptions
- Remove duplicate operation IDs
Validate references
Check that all referenced schemas and components exist. Common issues include:- Missing
$reftargets - Broken schema references
- Circular references that cannot be resolved
Verify your server URL
Ensure your specification defines a valid upstream API endpoint. For example:- OpenAPI 3.x uses the
serverssection. - Swagger 2.0 uses
host,basePath, andschemes.
Importing from a URL
If you’re importing from a public URL:- The URL must be publicly accessible.
- It should return the OpenAPI document directly.
- It must not redirect to a login page or HTML documentation.
A URL that works only after you sign in to a browser is not publicly accessible to the importer.
Isolate the problem
If the error isn’t obvious:- Create a smaller version of the specification containing a single endpoint.
- Import the reduced document.
- Gradually add paths and components back until the error reappears.