Product-apim: Improve OAS definition to support Micro GW

Created on 7 Oct 2019  ·  11Comments  ·  Source: wso2/product-apim

At the moment follwing custom attributes are support in OAS definition. Please review and suggest if there is anything to improve.

x-wso2-auth-header: "Authorization"
x-throttling-tier: "Unlimited"
x-wso2-cors:
corsConfigurationEnabled: false
accessControlAllowOrigins:
- "*"
accessControlAllowCredentials: false
accessControlAllowHeaders:
- "authorization"
- "Access-Control-Allow-Origin"
- "Content-Type"
- "SOAPAction"
accessControlAllowMethods:
- "GET"
- "PUT"
- "POST"
- "DELETE"
- "PATCH"
- "OPTIONS"
x-wso2-production-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
x-wso2-sandbox-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
x-wso2-basePath: "/sample/1.0.0"
x-wso2-transports:
- "http"
- "https"

For each endpoint type, it's configuration is as follows.

HTTP
x-wso2-production-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
x-wso2-sandbox-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"

HTTP failover
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "failover"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "failover"

HTTP load balance
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "load_balance"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "load_balance"

SOAP
x-wso2-production-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
x-wso2-sandbox-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"

SOAP fialover
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "failover"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "failover"

SOAP load balance
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "load_balance"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "load_balance"

Default endpoints
x-wso2-production-endpoints:
endpoint_type: "default"
x-wso2-sandbox-endpoints:
endpoint_type: "default"

All 11 comments

Could we change the
endpoint_type: "http" -> type: "http"

Need x-wso2-disable-security to disable security for resources https://github.com/wso2/product-microgateway#microgateway-supported-open-api-extensions

Needs to change
url -> urls

x-throttling-tier: "Unlimited"
This should be x-wso2-throttling-tier

whether a single endpoint or not, it has to be an array.
url: "https://localhost:9443/publisher/apis/create/rest" ->
urls:

HTTP failover
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "failover"

needs to be changed to

HTTP failover
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
type: "failover"

Same goes with the load balance endpoints

Need x-wso2-disable-security to disable security for resources https://github.com/wso2/product-microgateway#microgateway-supported-open-api-extensions

@praminda This information is already there under the name 'x-auth-type". Can we reuse that?

x-throttling-tier: "Unlimited"
This should be x-wso2-throttling-tier

@hasuniea This information is already there with the name 'x-throttling-tier'. Can we resue it? otherwise there will be duplicate information in the swagger.

x-throttling-tier

Right now micro gateway supports x-throttling-tier, hence it is a duplication of data, I assume we can keep it as it as

x-auth-type

Yes we can use this extension, since we support it at MGW

This issue is fixed. Hence closing.

Was this page helpful?
0 / 5 - 0 ratings