Skip to content

Commit e27ea92

Browse files
feat(platform-api): add per-operation upstream override to the OpenAPI schema
1 parent e6e8d18 commit e27ea92

1 file changed

Lines changed: 38 additions & 8 deletions

File tree

platform-api/src/resources/openapi.yaml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6328,7 +6328,7 @@ components:
63286328
$ref: "#/components/schemas/Upstream"
63296329
upstreamDefinitions:
63306330
type: array
6331-
description: List of reusable named upstream definitions. API-level upstream `ref` values resolve against entries here by name.
6331+
description: List of reusable named upstream definitions. Both API-level and operation-level upstream `ref` values resolve against entries here by name.
63326332
items:
63336333
$ref: '#/components/schemas/ReusableUpstream'
63346334
lifeCycleStatus:
@@ -6478,6 +6478,8 @@ components:
64786478
description: List of policies to be applied on the operation
64796479
items:
64806480
$ref: "#/components/schemas/Policy"
6481+
upstream:
6482+
$ref: "#/components/schemas/OperationUpstream"
64816483

64826484
ChannelRequest:
64836485
title: Channel Request
@@ -8389,6 +8391,39 @@ components:
83898391
auth:
83908392
$ref: '#/components/schemas/UpstreamAuth'
83918393

8394+
OperationUpstream:
8395+
title: Operation Upstream
8396+
type: object
8397+
additionalProperties: false
8398+
minProperties: 1
8399+
description: Per-operation upstream override. Each sub-field must reference a named entry in upstreamDefinitions. Missing sub-fields fall back to the API-level upstream. At least one of main or sandbox must be set.
8400+
properties:
8401+
main:
8402+
type: object
8403+
additionalProperties: false
8404+
required:
8405+
- ref
8406+
properties:
8407+
ref:
8408+
$ref: '#/components/schemas/UpstreamReference'
8409+
sandbox:
8410+
type: object
8411+
additionalProperties: false
8412+
required:
8413+
- ref
8414+
properties:
8415+
ref:
8416+
$ref: '#/components/schemas/UpstreamReference'
8417+
8418+
UpstreamReference:
8419+
title: Upstream Reference
8420+
type: string
8421+
description: Name of a ReusableUpstream entry in the API's upstreamDefinitions pool. Used by both API-level and operation-level upstream refs.
8422+
minLength: 1
8423+
maxLength: 100
8424+
pattern: '^[a-zA-Z0-9\-_]+$'
8425+
example: my-upstream-1
8426+
83928427
UpstreamAuth:
83938428
type: object
83948429
description: Authentication configuration for upstream endpoints
@@ -8415,15 +8450,10 @@ components:
84158450
required:
84168451
- name
84178452
- upstreams
8418-
description: A reusable named upstream definition. Referenced by name from an API-level upstream.ref.
8453+
description: A reusable named upstream definition. Referenced by name from API-level and operation-level upstream refs.
84198454
properties:
84208455
name:
8421-
type: string
8422-
description: Unique identifier for this upstream definition
8423-
minLength: 1
8424-
maxLength: 100
8425-
pattern: '^[a-zA-Z0-9\-_]+$'
8426-
example: my-upstream-1
8456+
$ref: '#/components/schemas/UpstreamReference'
84278457
basePath:
84288458
type: string
84298459
description: Base path prefix prepended to all requests routed to this upstream (e.g., /api/v2)

0 commit comments

Comments
 (0)