Skip to content

Commit 160797a

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 d29618a commit 160797a

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
@@ -237,34 +237,6 @@ paths:
237237
application/json:
238238
schema:
239239
$ref: "#/components/schemas/Error"
240-
/{tokenEndPoint}:
241-
post:
242-
summary: Token Exchange endpoint
243-
description: >
244-
This optional endpoint allows to obtain a (potentially short-lived) bearer token in exchange for a secret.
245-
See [Resource Access](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#resource-access)
246-
for more details. The actual endpoint URL is discovered via OCM provider metadata
247-
(tokenEndPoint).
248-
requestBody:
249-
content:
250-
application/x-www-form-urlencoded:
251-
schema:
252-
$ref: "#/components/schemas/TokenRequest"
253-
description: Form-encoded request body.
254-
required: true
255-
responses:
256-
"200":
257-
description: Token issued.
258-
content:
259-
application/json:
260-
schema:
261-
$ref: "#/components/schemas/TokenResponse"
262-
"400":
263-
description: Token denied.
264-
content:
265-
application/json:
266-
schema:
267-
$ref: "#/components/schemas/Error"
268240
components:
269241
parameters:
270242
id:
@@ -505,9 +477,37 @@ components:
505477
example: ed25519
506478
tokenEndPoint:
507479
type: string
480+
format: uri
508481
description: >
509482
Optional URL path of the Token Exchange endpoint to obtain bearer tokens in exchange for codes.
510483
If the `exchange-token` capability is exposed, the tokenEndPoint MUST be advertised in the discovery response.
484+
485+
486+
**Token Exchange API:**
487+
488+
This optional endpoint allows obtaining a (potentially short-lived) bearer token in exchange for a secret.
489+
See [Resource Access](https://github.com/cs3org/OCM-API/blob/develop/IETF-RFC.md#resource-access) for more details.
490+
491+
492+
**HTTP Request:**
493+
494+
- Method: POST
495+
496+
- URL: The URL discovered in this field
497+
498+
- Content-Type: application/x-www-form-urlencoded
499+
500+
- Body: TokenRequest schema (form-encoded, required)
501+
502+
503+
**HTTP Responses:**
504+
505+
- 200: Token issued (application/json with TokenResponse schema)
506+
507+
- 400: Token denied (application/json with Error schema)
508+
509+
510+
See TokenRequest and TokenResponse schemas for the complete data structure.
511511
example: /index.php/apps/sciencemesh/token
512512
inviteAcceptDialog:
513513
type: string

0 commit comments

Comments
 (0)