# Debugging Error 500 on Swagger Upload

# Overview

The purpose of this article is to provide additional support to users experiencing error code 500: "API Connection Error". For other error codes please see Common Failure Reason for Swagger Files Upload.

# Potential Causes

While error code usually represents a general failure of the system to upload the Swagger specification, the most common reason is incorrect Swagger syntax as per the requirement of OpenAPI Specification 3.x and Swagger 2.x.

# How to Fix?

To fix your swagger syntax you may first want to understand how a Swagger document is structured. The Swagger documentation (opens new window) provides helpful resources to learn more.

There are two types of syntax errors that may exist in your Swagger file:

  1. Formatting errors. These are not specific to Swagger, but rather the YAML or JSON format that stores your Swagger specification. Double check that all your brackets and quotes are paired up properly.
  2. Swagger validation errors. This has to do with what objects are allowed to be where in your document according to Swagger rules. A Swagger file may have valid JSON or YAML formatting but still violate Swagger rules.

Thankfully, both of these errors can be resolved by using a linter. A linter is a tool for highlighting errors in your text editor (usually VSCode). You can try some open source tools such as the openapi-lint (opens new window) extension. Alternatively, you can import your Swagger file to the official Swagger web editor (opens new window), and it will display any errors you may have.

# Still getting this error code?

In the unlikely scenario that our services are under maintenance or are experiencing problems, you may receive this code even with a correct Swagger file. In this case, please send us an email at support@openapihub.com, and we will get back to you as soon as possible!

# Conclusion

Error 500 can be a scary error to receive, but don't worry! Double-check your Swagger file, and re-upload it again. If you still experience other error codes, refer to Common Failure Reason for Swagger Files Upload for more details!