How do I create a new version of an API?
When you create a new version of an API, the API gallery page displays the latest version of the API. You can view all versions of the from the Manage APIs page. The API details page has a drop-down list that displays all API versions.
You can create new versions of an API for the use of a different set of consumers or with different security policies. New data can also be updated to the existing meta-data when you create new versions of your APIs.
The new API has the same metadata but with an updated version. The version can either be a number or a string.
Different versions of an API can be added to different communities and can be associated with different packages.
This use case starts when you want to create a new version of an existing API and ends when you created a new version of an API.
In this example, consider creating a new version of the API, Petstore 2.0 and map the newer version to the Public community.
To create a new version of an API 1. Click
from the title bar and click
Manage APIs.
The list of APIs appear.
2. Click the version icon
next to the API,
Petstore.
3. Provide 2.0 in the Version field.
4. Select Swagger from the Type list.
5. Select Provider1 in the Provider field.
6. Select Public from the Community field.
7. Select URL from the Import with section and provide https://petstore.swagger.io/v2/swagger.json in the field.
8. Click Save.
A new version of the API, Petstore is created.
Note:
When you version an API, you can create versions from the newer version of the API and not from the older version.
In the example, note that the older API does not have the version icon
appearing next to it.
Alternative flow
1. You can update the API by uploading a new file or by providing a new URL or pasting new content.
2. You can also map the API to another provider.
Next steps
All consumers can view the newer verison of the API as it is a part of the public community.