Skip to main content

Check out Port for yourselfย 

Swagger UI

The Swagger UI property is used to import and display OpenAPI and/or AsyncAPI specification files within an entity in Port.

Using this property will automatically create an additional tab in each entity page, displaying the specification files in Swagger UI format. Within this tab, you will be able to perform HTTP calls to the spec target directly from Port.

The following is an example of a Swagger UI tab in an entity page:

OpenAPIโ€‹

Definitionโ€‹

When using the URL format, Port will query the provided URL for the OpenAPI spec and expects a JSON OpenAPI spec

note

When using URL for the open-api display please make sure that your server allows cross-origin (CORS) requests from app.getport.io.

To serve the OpenAPI spec from an AWS S3 bucket, please add a CORS policy to the bucket that allows requests from app.getport.io, check out the AWS documentation for more information.

{
"myOpenApi": {
"title": "My Open API",
"type": "string",
"format": "url",
"spec": "open-api",
"description": "Open-API Prop"
}
}

Exampleโ€‹

Here is how the Swagger tab in the specific entity page appears when an OpenAPI spec is provided:

OpenAPI Example

AsyncAPIโ€‹

Definitionโ€‹

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

To serve the OpenAPI spec from an AWS S3 bucket, please add a CORS policy to the bucket that allows requests from app.getport.io, check out the AWS documentation for more information.

{
"myAsyncApi": {
"title": "My Async API",
"type": "string",
"format": "url",
"spec": "async-api",
"description": "async-api Prop"
}
}

Exampleโ€‹

Here is how the Swagger tab in the specific entity page appears when an AsyncAPI spec is provided:

AsyncAPI Example