AsyncAPI
With Port, you can import and display AsyncAPI specification files as Swagger UI tabs.
By using a special Async API Blueprint property, Port will display the Swagger UI matching the spec file provided in the Specific entity page.
Definitionโ
- URL
- Object
When using the URL format, Port will query the provided URL for the AsyncAPI spec and expects a JSON AsyncAPI spec
note
When using URL for the async-api
display please make sure that your server allows cross-origin (CORS) requests from app.getport.io
- API
- Terraform
{
"myAsyncApi": {
"title": "My Async API",
"type": "string",
"format": "url",
"spec": "async-api",
"description": "async-api Prop"
}
}
resource "port-labs_blueprint" "myBlueprint" {
# ...blueprint properties
properties {
identifier = "myAsyncApi"
title = "My Async API"
required = false
type = "string"
format = "url"
spec = "async-api"
}
}
When using the object type, you will have to provide the full JSON AsyncAPI spec as an object to the Entity
- API
- Terraform
{
"myAsyncApi": {
"title": "My Async API",
"type": "object",
"spec": "async-api",
"description": "async-api Prop"
}
}
resource "port-labs_blueprint" "myBlueprint" {
# ...blueprint properties
properties {
identifier = "myAsyncApi"
title = "My Async API"
required = false
type = "object"
spec = "async-api"
}
}
Exampleโ
Here is how the Swagger tab in the specific entity page appears when an AsyncAPI spec is provided:
note
Only AsyncAPI versions 2.0.0 up to 2.4.0 are supported at the moment.