Skip to main content
Version: 2.5

Import OpenAPI Guide

The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection.

Apache APISIX Dashboard supports importing OpenApi3.0(we will use OAS3.0 for short) files to create the Route. Currently we support support most of the OpenApi specifications, but there are some differences, which are in terms of compatibility and extended fields.

OAS3.0 Compatibility#

when we import routes from OAS3.0, some fields in OAS will be missed because there are not corresponding fields in APISIX's Route:

  1. API General Info: used to describe the general information about your API, some times, a oas file contains a series of apis which belong to a app, so this info is different from the api's name and extra basic info.

  2. API server and base path: upsream url + url prefix(options).

  3. Path params: api params described in path.

  4. Query params: api params described in query.

  5. Responses description and links: Define the responses for a API operations.

Extended fields#

There are some fields required in APISIX Route but are not included in the properties of OAS3.0, we added some extended fields such as upstream, plugins, hosts and so on. All extensions start with x-apisix. See reference For more details of the APISIX Route Properties

Extended fieldsAPISIX Route Properties
x-apisix-pluginsplugins
x-apisix-scriptscript
x-apisix-upstreamupstream
x-apisix-service_protocolservice_protocol
x-apisix-hosthost
x-apisix-hostshosts
x-apisix-remote_addrremote_addr
x-apisix-prioritypriority
x-apisix-varsvars
x-apisix-filter_funcfilter_func
x-apisix-labelslabels
x-apisix-enable_websocketenable_websocket
x-apisix-statusstatus
x-apisix-create_timecreate_time
x-apisix-update_timeupdate_time