Skip to content

Commit 7aec88b

Browse files
committed
Fix validation error for tokenEndPoint
The tokenEndPoint does not pass validation: spec.yaml: Validation Error: Path parameter 'tokenEndPoint' for 'post' operation in '/{tokenEndPoint}' was not resolved (using openapi-spec-validator) This is an attempt to fix that by removing the endpoint and adding the information under the discovery instead, since this endpoint is discovered rather than fixed, I _think_ this is how it should be done.
1 parent fd30ab6 commit 7aec88b

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

spec.yaml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -231,34 +231,6 @@ paths:
231231
application/json:
232232
schema:
233233
$ref: "#/components/schemas/Error"
234-
/{tokenEndPoint}:
235-
post:
236-
summary: Token Exchange endpoint
237-
description: >
238-
This optional endpoint allows to obtain a (potentially short-lived) bearer token in exchange for a secret.
239-
See [Resource Access](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#resource-access)
240-
for more details. The actual endpoint URL is discovered via OCM provider metadata
241-
(tokenEndPoint).
242-
requestBody:
243-
content:
244-
application/x-www-form-urlencoded:
245-
schema:
246-
$ref: "#/components/schemas/TokenRequest"
247-
description: Form-encoded request body.
248-
required: true
249-
responses:
250-
"200":
251-
description: Token issued.
252-
content:
253-
application/json:
254-
schema:
255-
$ref: "#/components/schemas/TokenResponse"
256-
"400":
257-
description: Token denied.
258-
content:
259-
application/json:
260-
schema:
261-
$ref: "#/components/schemas/Error"
262234
components:
263235
parameters:
264236
id:
@@ -456,9 +428,37 @@ components:
456428
-----END PUBLIC KEY-----
457429
tokenEndPoint:
458430
type: string
431+
format: uri
459432
description: >
460433
Optional URL path of the Token Exchange endpoint to obtain bearer tokens in exchange for codes.
461434
If the `exchange-token` capability is exposed, the tokenEndPoint MUST be advertised in the discovery response.
435+
436+
437+
**Token Exchange API:**
438+
439+
This optional endpoint allows obtaining a (potentially short-lived) bearer token in exchange for a secret.
440+
See [Resource Access](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#resource-access) for more details.
441+
442+
443+
**HTTP Request:**
444+
445+
- Method: POST
446+
447+
- URL: The URL discovered in this field
448+
449+
- Content-Type: application/x-www-form-urlencoded
450+
451+
- Body: TokenRequest schema (form-encoded, required)
452+
453+
454+
**HTTP Responses:**
455+
456+
- 200: Token issued (application/json with TokenResponse schema)
457+
458+
- 400: Token denied (application/json with Error schema)
459+
460+
461+
See TokenRequest and TokenResponse schemas for the complete data structure.
462462
example: /index.php/apps/sciencemesh/token
463463
inviteAcceptDialog:
464464
type: string

0 commit comments

Comments
 (0)