This document describes how to create APIs by importing OpenAPI definitions in the API Gateway console.
- You have created a service.
- An API description file compliant with the OpenAPI Specification 3.0.0 is available, and the text format is YAML or JSON.
- Log in to the API Gateway console and click Service in the left sidebar.
- In the service list, click the name of the target service to view it.
- On the service information page, click the Manage API tab to view the API list of the service.
- Click Import API at the top of the API list to access the API importing page.
- Select a text format (YAML or JSON). Click Upload File and select an API description file to upload, or directly enter the API description information in the code editor.
- Click Save. The API Gateway then creates APIs based on your input and returns a list of successfully created APIs.
- Only APIs whose backend is Mock can be imported currently. You can modify the backend configurations of the APIs after importing them successfully.
- An API description file to be imported must comply with the OpenAPI Specification 3.0.0 and be in the YAML or JSON format.
- A maximum of 10 APIs can be imported at a time.
- When you upload an API description file, ensure that the file name extension is .yaml or .json and that the file size is less than or equal to 100 KB. After being uploaded successfully, the API description file will replace the content in the code editor.
- Successfully created APIs cannot be published automatically. Instead, you must manually publish them so that they can take effect.