From 1d9356f0d4a89f8650af4cf3fc26920c4621c1a5 Mon Sep 17 00:00:00 2001 From: Matthias Pichler Date: Mon, 3 Jun 2024 15:23:50 +0000 Subject: [PATCH] fix: define custom uri type Signed-off-by: Matthias Pichler --- schema/workflow.yaml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/schema/workflow.yaml b/schema/workflow.yaml index d98321f3..6d6cd0db 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -302,8 +302,7 @@ $defs: type: string description: The event's unique identifier source: - type: string - format: uri + $ref: '#/$defs/uri' description: Identifies the context in which an event happened type: type: string @@ -317,8 +316,7 @@ $defs: type: string description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format. dataschema: - type: string - format: uri + $ref: '#/$defs/uri' required: [ source, type ] additionalProperties: true required: [ event ] @@ -567,8 +565,7 @@ $defs: type: object properties: authority: - type: string - format: uri + $ref: '#/$defs/uri' description: The URI that references the OAuth2 authority to use. grant: type: string @@ -643,15 +640,14 @@ $defs: type: object properties: type: - type: string - format: uri + $ref: '#/$defs/uri' description: A URI reference that identifies the error type. status: type: integer description: The status code generated by the origin for this occurrence of the error. instance: type: string - format: uri + format: json-pointer description: A JSON Pointer used to reference the component the error originates from. title: type: string @@ -664,8 +660,7 @@ $defs: type: object properties: uri: - type: string - format: uri + $ref: '#/$defs/uri' description: The endpoint's URI. authentication: $ref: '#/$defs/authenticationPolicy' @@ -757,8 +752,7 @@ $defs: type: object properties: uri: - type: string - format: uri + $ref: '#/$defs/uri' description: The endpoint's URI. authentication: $ref: '#/$defs/authenticationPolicy' @@ -875,4 +869,12 @@ $defs: description: The duration after which to timeout. required: [ after ] description: The definition of a timeout. + uri: + oneOf: + - type: string + format: uri + - type: string + # taken from [RFC3986](https://tools.ietf.org/html/rfc3986#appendix-B) + pattern: ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$ + required: [ document, do ] \ No newline at end of file