Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/src/utils/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func GenerateMCPConfigFile(url string, toolsResult ToolsResult,
resourcesResult ResourcesResult, promptsResult PromptsResult, outputDir string) error {
// Build YAML
mcp := McpYAML{
Version: "ai.api-platform.wso2.com/v1",
Version: "ai.api-platform.wso2.com/v1alpha1",
Kind: "mcp",
}
mcp.Spec.Name = "Generated-MCP"
Expand Down
8 changes: 4 additions & 4 deletions concepts/api-yaml-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `api.yaml` format is a declarative specification for defining APIs that can

```yaml
version: api-platform.wso2.com/v1
kind: http/rest | graphql | grpc | asyncapi
kind: RestApi | graphql | grpc | asyncapi
data:
# API metadata and configuration
```
Expand All @@ -26,7 +26,7 @@ data:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `version` | string | Yes | API specification version (currently `api-platform.wso2.com/v1`) |
| `kind` | string | Yes | API type: `http/rest`, `graphql`, `grpc`, `asyncapi` |
| `kind` | string | Yes | API type: `RestApi`, `graphql`, `grpc`, `asyncapi` |
| `data` | object | Yes | API configuration and metadata |

### Data Object Fields
Expand Down Expand Up @@ -69,7 +69,7 @@ data:

```yaml
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
data:
name: Weather API
version: v1.0
Expand All @@ -89,7 +89,7 @@ data:

```yaml
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
data:
name: User Management API
version: v1.0
Expand Down
2 changes: 1 addition & 1 deletion docs/gateway/Quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ curl -X POST http://localhost:9090/apis \
-H "Content-Type: application/yaml" \
--data-binary @- <<'EOF'
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: Weather-API
version: v1.0
Expand Down
4 changes: 2 additions & 2 deletions docs/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ curl -X POST http://localhost:9090/apis \
-H "Content-Type: application/yaml" \
--data-binary @- <<'EOF'
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: Weather-API
version: v1.0
Expand Down Expand Up @@ -144,7 +144,7 @@ User → Gateway-Controller (REST API)

```yaml
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
data:
name: Weather API
version: v1.0
Expand Down
4 changes: 2 additions & 2 deletions gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ curl -X POST http://localhost:9090/apis \
-H "Content-Type: application/yaml" \
--data-binary @- <<'EOF'
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: Weather-API
version: v1.0
Expand Down Expand Up @@ -144,7 +144,7 @@ User → Gateway-Controller (REST API)

```yaml
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
data:
name: Weather API
version: v1.0
Expand Down
2 changes: 1 addition & 1 deletion gateway/examples/petstore-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# --------------------------------------------------------------------

version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: PetStore API test
version: v1.0
Expand Down
2 changes: 1 addition & 1 deletion gateway/examples/self-signed-secure-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
# --------------------------------------------------------------------
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: self-signed-api
version: v1.0
Expand Down
30 changes: 30 additions & 0 deletions gateway/examples/test-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# --------------------------------------------------------------------
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# --------------------------------------------------------------------

version: api-platform.wso2.com/v1
kind: RestApi
spec:
name: test-api
version: v1.0
context: /test
upstreams:
- url: https://secure-backend:5443/api/v2
# - url: http://httpbin.org/anything
operations:
- method: GET
path: /info
2 changes: 1 addition & 1 deletion gateway/examples/weather-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# --------------------------------------------------------------------

version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: Weather-API
version: v1.0
Expand Down
4 changes: 2 additions & 2 deletions gateway/examples/websubhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# --------------------------------------------------------------------

version: api-platform.wso2.com/v1
kind: async/websub
kind: WebsubApi
spec:
name: WebSub-API-New-API
apiType: async/websub
apiType: WebsubApi
version: v1.0
context: /websubnewapi
servers:
Expand Down
6 changes: 3 additions & 3 deletions gateway/gateway-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ POST /apis
Content-Type: application/yaml

version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
data:
name: Weather API
version: v1.0
Expand Down Expand Up @@ -295,7 +295,7 @@ PUT /apis/Weather%20API/v1.0
Content-Type: application/yaml

version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
data:
name: Weather API
version: v1.0
Expand Down Expand Up @@ -336,7 +336,7 @@ The SQLite database contains the following table:
| `name` | TEXT | API name (indexed for fast lookups) |
| `version` | TEXT | API version (indexed for fast lookups) |
| `context` | TEXT | Base path (e.g., "/weather") |
| `kind` | TEXT | API type ("http/rest", "graphql", etc.) |
| `kind` | TEXT | API type ("RestApi", "graphql", etc.) |
| `configuration` | TEXT | Full JSON-serialized API configuration |
| `status` | TEXT | Deployment status ("pending", "deployed", "failed") |
| `created_at` | TIMESTAMP | Record creation timestamp |
Expand Down
32 changes: 16 additions & 16 deletions gateway/gateway-controller/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ paths:
$ref: "#/components/schemas/APIConfiguration"
example:
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: PetStore API
version: v1.0
Expand Down Expand Up @@ -116,7 +116,7 @@ paths:
$ref: "#/components/schemas/APIConfiguration"
example:
version: api-platform.wso2.com/v1
kind: http/rest
kind: RestApi
spec:
name: PetStore API
version: v1.0
Expand Down Expand Up @@ -1270,25 +1270,25 @@ components:
APIConfiguration:
type: object
required:
- version
- apiVersion
- kind
- spec
properties:
version:
apiVersion:
type: string
description: API specification version
example: api-platform.wso2.com/v1
enum:
- api-platform.wso2.com/v1
- gateway.api-platform.wso2.com/v1alpha1
kind:
type: string
description: API type
example: http/rest
example: RestApi
enum:
- http/rest
- async/websub
- async/websocket
- async/sse
- RestApi
- WebsubApi
- WebsocketApi
- SseApi
spec:
description: API configuration payload (REST or Async API variants)
oneOf:
Expand All @@ -1297,8 +1297,8 @@ components:
discriminator:
propertyName: apiType
mapping:
http/rest: '#/components/schemas/APIConfigData'
async/websub: '#/components/schemas/WebhookAPIData'
RestApi: '#/components/schemas/APIConfigData'
WebsubApi: '#/components/schemas/WebhookAPIData'

APIConfigData:
type: object
Expand All @@ -1320,9 +1320,9 @@ components:
apiType:
type: string
description: API type
example: http/rest
example: RestApi
enum:
- http/rest
- RestApi
version:
type: string
description: Semantic version of the API
Expand Down Expand Up @@ -1478,9 +1478,9 @@ components:
apiType:
type: string
description: API type
example: async/websub
example: WebsubApi
enum:
- async/websub
- WebsubApi
name:
type: string
description: Human-readable API name (must be URL-friendly - only letters, numbers, spaces, hyphens, underscores, and dots allowed)
Expand Down
2 changes: 1 addition & 1 deletion gateway/gateway-controller/cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func main() {
derivedCount := 0
for _, apiConfig := range loadedAPIs {
// Derive policy configuration from API
if apiConfig.Configuration.Kind == "http/rest" {
if apiConfig.Configuration.Kind == "RestApi" {
storedPolicy := derivePolicyFromAPIConfig(apiConfig, &cfg.Router)
if storedPolicy != nil {
if err := policyStore.Set(storedPolicy); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions gateway/gateway-controller/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ router:
port: 9001

# Timeout for gRPC service connection (in milliseconds)
timeout_ms: 250
timeout_ms: 4250

# Failure mode: false = fail closed (deny requests on error), true = fail open (allow requests on error)
failure_mode_allow: false
Expand All @@ -160,7 +160,7 @@ router:
request_header_mode: SEND

# Message timeout for policy engine processing (in milliseconds)
message_timeout_ms: 250
message_timeout_ms: 4250

# TLS configuration for policy engine connection
tls:
Expand Down
Loading