Fix definition of response of `POST /_matrix/federation/v1/user/keys/claim` (#1559)

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
dbkr/3077-multi-stream-voip
Kévin Commaille 1 year ago committed by GitHub
parent 746524928c
commit 50fe89d74b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1 @@
Fix definition of response of `POST /_matrix/federation/v1/user/keys/claim`.

@ -71,7 +71,9 @@ paths:
type: object
# Key
additionalProperties:
type: object
oneOf:
- type: string
- type: object
title: KeyObject
properties:
key:

@ -91,6 +91,21 @@
{{ end }}
{{ end }}
{{/*
Handle object schemas using the `oneOf` keyword
(https://json-schema.org/understanding-json-schema/reference/combining.html#oneof)
*/}}
{{ if $this_object.oneOf }}
{{ range $idx, $item := $this_object.oneOf }}
{{ $additional_objects = partial "get-additional-objects" (dict
"this_object" $item
"additional_objects" $additional_objects
"anchor_base" $anchor_base
"name" (printf "%s.oneOf[%d]" $name $idx)
) }}
{{ end }}
{{ end }}
{{ return $additional_objects }}

@ -36,7 +36,7 @@
{{ $property := partial "json-schema/resolve-allof" $property }}
{{ $type := $property.type }}
{{ if eq $property.type "object" }}
{{ if or (eq $property.type "object") (and $property.oneOf (reflect.IsSlice .oneOf)) }}
{{ $type = partial "type-or-title" $property }}
{{ end }}
@ -121,7 +121,7 @@
{{ $types := slice }}
{{ range .oneOf }}
{{ $types = $types | append .type }}
{{ $types = $types | append (partial "type-or-title" .) }}
{{ end }}
{{ $type = delimit $types "|" }}

Loading…
Cancel
Save