curl --request PATCH \
--url https://{tenant}/api/apis/streams/{apiId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"components": {
"securitySchemes": {
"bearerAuth": {
"description": "The API Access Credentials",
"scheme": "bearer",
"type": "http"
}
}
},
"info": {
"description": "This is a sample Streams API.",
"title": "Streams Sample",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/api/sample/users": {
"get": {
"operationId": "getUsersSample",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"properties": {
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"description": "fetched users"
}
},
"summary": "Get users",
"tags": [
"users"
]
}
}
},
"security": [
{
"bearerAuth": []
}
],
"servers": [
{
"url": "https://localhost:8080"
}
],
"x-tyk-api-gateway": {
"info": {
"name": "user",
"state": {
"active": true
}
},
"server": {
"listenPath": {
"strip": true,
"value": "/user-test-six/"
}
},
"upstream": {
"url": "https://localhost:8080"
}
},
"x-tyk-streaming": {
"streams": {
"stream1": {
"input": {
"kafka": {
"addresses": [
"localhost:9093"
],
"auto_replay_nacks": true,
"checkpoint_limit": 1024,
"consumer_group": "group1",
"target_version": "3.3.0",
"topics": [
"instrument.json.AMZN",
"instrument.json.GOOG"
]
}
},
"output": {
"broker": {
"outputs": [
{
"stdout": {
"codec": "lines"
}
},
{
"http_server": {
"allowed_verbs": [
"GET"
],
"path": "/one",
"stream_path": "/sse",
"ws_path": "/ws"
}
}
],
"pattern": "fan_out"
}
}
}
}
}
}
'{
"Message": "API updated",
"Meta": null,
"Status": "OK"
}Update a Tyk Streams API. You can use this endpoint to update the OAS part of your Tyk Streams API definition. This endpoint allows you to configure the Tyk OAS extension based on the query parameters provided (similar to import).
curl --request PATCH \
--url https://{tenant}/api/apis/streams/{apiId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"components": {
"securitySchemes": {
"bearerAuth": {
"description": "The API Access Credentials",
"scheme": "bearer",
"type": "http"
}
}
},
"info": {
"description": "This is a sample Streams API.",
"title": "Streams Sample",
"version": "1.0.0"
},
"openapi": "3.0.3",
"paths": {
"/api/sample/users": {
"get": {
"operationId": "getUsersSample",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"properties": {
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
},
"description": "fetched users"
}
},
"summary": "Get users",
"tags": [
"users"
]
}
}
},
"security": [
{
"bearerAuth": []
}
],
"servers": [
{
"url": "https://localhost:8080"
}
],
"x-tyk-api-gateway": {
"info": {
"name": "user",
"state": {
"active": true
}
},
"server": {
"listenPath": {
"strip": true,
"value": "/user-test-six/"
}
},
"upstream": {
"url": "https://localhost:8080"
}
},
"x-tyk-streaming": {
"streams": {
"stream1": {
"input": {
"kafka": {
"addresses": [
"localhost:9093"
],
"auto_replay_nacks": true,
"checkpoint_limit": 1024,
"consumer_group": "group1",
"target_version": "3.3.0",
"topics": [
"instrument.json.AMZN",
"instrument.json.GOOG"
]
}
},
"output": {
"broker": {
"outputs": [
{
"stdout": {
"codec": "lines"
}
},
{
"http_server": {
"allowed_verbs": [
"GET"
],
"path": "/one",
"stream_path": "/sse",
"ws_path": "/ws"
}
}
],
"pattern": "fan_out"
}
}
}
}
}
}
'{
"Message": "API updated",
"Meta": null,
"Status": "OK"
}The Tyk Dashboard API Access Credentials
Content type for streams endpoints should be application/vnd.tyk.streams.oas
application/vnd.tyk.streams.oas ID of the API you want to patch.
Listen path for the API.
Custom domain for the API.
Enable allowList middleware for all endpoints.
true, false true
Enable validateRequest middleware for all endpoints having a request body with media type application/json.
true, false true
Enable mockResponse middleware for all endpoints having responses configured.
true, false true
Enable/disable the authentication mechanism in your Tyk Gateway for your OAS API.
true, false true
The content of the file should be the OpenAPI document in JSON format.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?