-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New IA - Gateway Manage APIs #5896
base: master
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
From the Tyk Dashboard, select Users from the System Management section. Click Edit for your user, then scroll to the bottom of the page. Your Dashboard API Key is the first entry: {{< img src="/img/oas/edit-profile.png" alt="User Edit Profile menu" >}} We recommend that you store your Dashboard API Key, Dashboard URL & Gateway URL as environment variables so you don’t need to keep typing them in:
Check which APIs are already loaded You can query the
{{< note success >}} For a fresh install, you will see that no APIs currently exist Create your first Tyk OAS API To create the API in Tyk, you simply send your Tyk OAS API Definition to the
Using this API definition it is possible to create a Tyk OAS API on your Tyk Gateway that forwards requests to the [Swagger Petstore]({{< ref "https://petstore3.swagger.io" >}}) request/response service.
If the command succeeds, you will see the following response, where
Test your new API The Swagger Petstore provides plenty of endpoints to allow you to test different REST methods and operations. In this tutorial we will first add ( Create a new pet in the store using this
Retrieve the pet that has just been created using this
What you have done is send a request to the Tyk Gateway on the listen path The Gateway stripped the listen path, and reverse proxied the request to https://petstore3.swagger.io Using the Tyk Dashboard GUITyk Dashboard has a new and improved API Designer that you'll use when working with Tyk OAS APIs. In this tutorial we guide you through the steps to create a new Tyk OAS API using the GUI. {{< youtube -LyJ14wuOrI >}} Steps for Configuration
To see the URL given to your API, check the Info section displayed at the top of the page:
Using Tyk OperatorYou can make use of Tyk Operator custom resources to configure [Tyk OAS API]({{<ref "getting-started/using-oas-definitions/oas-glossary#tyk-oas-api-definition">}}) in a Kubernetes environment. In this [tutorial]({{<ref "/api-management/automations#set-up-oas-api">}}) we guide you through the steps to create a new Tyk OAS API using Tyk Operator. Update a Tyk OAS APIAs developers working on API development, it can be necessary for us to regularly update our API definition as, for example, we add endpoints or support new methods. This definition is normally generated either from our codebase or created using API design tools (such as [Swagger Editor]({{< ref "https://editor.swagger.io/" >}}), [Postman]({{< ref "https://www.postman.com/" >}}) and [Stoplight]({{< ref "https://stoplight.io/" >}})). One of the most powerful features of working with Tyk OAS is that you can make changes to your [Tyk OAS API Definition]({{< ref "/getting-started/using-oas-definitions/oas-glossary#tyk-oas-api-definition" >}}) or [OpenAPI Document]({{< ref "/getting-started/using-oas-definitions/oas-glossary#openapi-document" >}}) outside Tyk and then use this updated description to update the Tyk OAS API. You can simply update the configuration on Tyk without having to make any changes to the Tyk Gateway configuration ( In this section will walk you through different methods you can use to Update a Tyk OAS API using the Tyk Gateway API, Tyk Dashboard API and Tyk Dashboard GUI. Differences between using the Tyk Dashboard API and Tyk Gateway APIThe examples in these tutorials have been written assuming that you are using the Tyk Gateway API. You can also run these steps using the Tyk Dashboard API, noting the differences summarised here:
{{< note success >}} You will also need to have ‘admin’ or ‘api’ rights if [RBAC]({{< ref "/tyk-dashboard/rbac.md" >}}) is enabled. Create and update a keyless Tyk OAS APISteps for Configuration
What did you just do? You sent an updated Tyk OAS API Definition to the Tyk Gateway's For a next step, continue to tutorial 2, where we will protect the new API by enabling authentication. Update your API with authenticationYou've now got an API deployed on your Tyk Gateway, but it is keyless - anyone can access it without authenticating themselves. Let's now add some security so that you can control who can access your service.
Update Tyk OAS API definition with an updated OpenAPI definition
What did you just do? You sent an updated OpenAPI Document to the Tyk Gateway's You have updated a Tyk OAS API, enabling authentication, using only the OpenAPI Document. You didn't have to work with the Tyk OAS API Definition, Tyk handled that for you. Versioning a Tyk OAS APITyk allows you to create versions of your APIs. When using Tyk OAS APIs versioning works slightly differently from with Tyk Classic APIs, to find out more please take a look at the dedicated [page]({{< ref "/getting-started/key-concepts/oas-versioning" >}}). If you're ready to dive in, then this tutorial shows you how easy it is to create and manage versions of your Tyk OAS APIs using the open source Tyk Gateway API, Tyk Dashboard API and the Tyk Dashboard GUI. Create a versioned API using the Tyk Gateway API or Tyk Dashboard APIThis tutorial takes you through the OAS API versioning process using the Tyk Gateway API. You can perform the same steps using the Tyk Dashboard API. Differences between using the Tyk Dashboard API and Tyk Gateway APIThis tutorial has been written assuming that you are using the Tyk Gateway API. You can also run these steps using the Tyk Dashboard API, noting the differences summarised here:
As explained in the section on [Creating an OAS API]({{< ref "/getting-started/using-oas-definitions/create-an-oas-api" >}}) remember that when using the Tyk Dashboard API you only need to issue one command to create the API and load it onto the Gateway; when using the Tyk Gateway API you must remember to restart or hot reload the Gateway after creating the API.
{{< note success >}} You will also need to have ‘admin’ or ‘api’ rights if [RBAC]({{< ref "/tyk-dashboard/rbac.md" >}}) is enabled.
What did you just do? In this tutorial you created two separate APIs that were designed to describe two different versions of an API. You delegated the responsibility of routing the requests to one of them (the Base API), and configured the second one to act as a secondary version (Version API). Create a versioned API with the Tyk Dashboard GUIThis tutorial takes you through the OAS API versioning process using your Tyk Dashboard.
{{< note success >}} After setting up a versioned API, when creating subsequent versions, the dialog box only asks you to add a new version name.
Export a Tyk OAS APITyk Gateway API and Tyk Dashboard API both support exporting the entire [Tyk OAS API Definition]({{< ref "/getting-started/using-oas-definitions/oas-glossary#tyk-oas-api-definition" >}}) or just the [OpenAPI Document]({{< ref "/getting-started/using-oas-definitions/oas-glossary#openapi-document" >}}) part so that you can manage or work on them outside Tyk. Differences between using the Tyk Dashboard API and Tyk Gateway APIThe examples in these tutorials have been written assuming that you are using the Tyk Gateway API. You can also run these steps using the Tyk Dashboard API, noting the differences summarised here:
{{< note success >}} You will also need to have ‘admin’ or ‘api’ rights if [RBAC]({{< ref "/tyk-dashboard/rbac.md" >}}) is enabled. Export the Tyk OAS API definition
The only thing you need to do in order to get the Tyk OAS API Definition for a specific API is to call the Tyk Gateway API's
Export just the OpenAPI Document
Tyk eases the integration with other applications, such as your Developer Portal, by allowing you to export just the OpenAPI Document. It does this by stripping out the To achieve this you simply add the
Import a Tyk OAS APITyk supports importing [OpenAPI Documents]({{< ref "/getting-started/using-oas-definitions/oas-glossary#openapi-document" >}}) (in JSON format, OAS version 3.0.x) using the Tyk Gateway API, the Tyk Dashboard API or the [Tyk Dashboard GUI]({{< ref "#tutorial-7-using-the-tyk-dashboard-ui" >}}). In the following tutorials, we provide the flows and commands you can use to get Tyk to generate the respective Tyk OAS API definitions from your OpenAPI Documents. Differences between using the Tyk Dashboard API and Tyk Gateway APIExamples in the following tutorials have been written assuming that you are using the Tyk Gateway API. You can also run these steps using the Tyk Dashboard API, noting the differences summarised here:
As explained in the section on [Creating an OAS API]({{< ref "/getting-started/using-oas-definitions/create-an-oas-api" >}}) remember that when using the Tyk Dashboard API you only need to issue one command to create the API and load it onto the Gateway; when using the Tyk Gateway API you must remember to restart or hot reload the Gateway after creating the API.
{{< note success >}} You will also need to have ‘admin’ or ‘api’ rights if [RBAC]({{< ref "/tyk-dashboard/rbac.md" >}}) is enabled. Create a Tyk OAS API by importing an OpenAPI Document
Steps for Configuration
What did you just do? You created a fully functional Tyk OAS API Definition by importing an OpenAPI Document. Tyk worked out and added all the information it needed so you didn’t have to! Let’s see next how you can enable extra capabilities of the Gateway when importing an OpenAPI Document. Create a Tyk OAS API with a custom upstream URL and listen path
What did you just do? You created a fully functional Tyk OAS API Definition by providing an OpenAPI Document and passing custom upstream URL and listen path. Create a secured API when importing an OpenAPI Document
Steps for Configuration
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
✅ PS. Pls add /docs/nightly to the end of url
To edit notification comments on pull requests, go to your Netlify site configuration. |
1 similar comment
✅ PS. Pls add /docs/nightly to the end of url
To edit notification comments on pull requests, go to your Netlify site configuration. |
User description
For internal users - Please add a Jira DX PR ticket to the subject!
Preview Link
Description
Screenshots (if appropriate)
Checklist
master
.PR Type
Documentation
Description
Added comprehensive documentation for managing Tyk Classic and OAS API definitions.
Included detailed tutorials for creating, updating, and securing APIs.
Provided examples for importing/exporting APIs and enabling advanced features.
Enhanced clarity with step-by-step guides, code snippets, and visual aids.
Changes walkthrough 📝
gateway-config-managing-classic.md
Added documentation for managing Tyk Classic APIs
tyk-docs/content/api-management/gateway-config-managing-classic.md
file-based mode.
gateway-config-managing-oas.md
Added documentation for managing Tyk OAS APIs
tyk-docs/content/api-management/gateway-config-managing-oas.md
advanced features.