mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 13:04:10 +01:00
Fix definition of response of POST /_matrix/federation/v1/user/keys/claim
Also fixes the rendering of nested OneOf. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
f4aa7c0327
commit
770bbd01a0
|
|
@ -71,26 +71,28 @@ paths:
|
||||||
type: object
|
type: object
|
||||||
# Key
|
# Key
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: object
|
oneOf:
|
||||||
title: KeyObject
|
- type: string
|
||||||
properties:
|
- type: object
|
||||||
key:
|
title: KeyObject
|
||||||
type: string
|
properties:
|
||||||
description: The key, encoded using unpadded base64.
|
key:
|
||||||
signatures:
|
|
||||||
type: object
|
|
||||||
title: Signatures
|
|
||||||
additionalProperties:
|
|
||||||
type: object
|
|
||||||
additionalProperties:
|
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: The key, encoded using unpadded base64.
|
||||||
Signature of the key object.
|
signatures:
|
||||||
|
type: object
|
||||||
|
title: Signatures
|
||||||
|
additionalProperties:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
Signature of the key object.
|
||||||
|
|
||||||
The signature is calculated using the process described at [Signing JSON](/appendices/#signing-json).
|
The signature is calculated using the process described at [Signing JSON](/appendices/#signing-json).
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- signatures
|
- signatures
|
||||||
example:
|
example:
|
||||||
"@alice:example.com":
|
"@alice:example.com":
|
||||||
JLAFKJWSCS:
|
JLAFKJWSCS:
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,20 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if and $this_object.oneOf (reflect.IsSlice $this_object.oneOf) }}
|
||||||
|
{{ range $idx, $item := $this_object.oneOf }}
|
||||||
|
/* although we expect resolve-allof to be called on the input, resolve-allof does not recurse into
|
||||||
|
* nested objects, so we have to call it again.
|
||||||
|
*/
|
||||||
|
{{ $item = partial "json-schema/resolve-allof" $item }}
|
||||||
|
{{ $additional_objects = partial "json-schema/resolve-additional-types" (dict
|
||||||
|
"schema" $item
|
||||||
|
"anchor_base" $anchor_base
|
||||||
|
"name" (printf "%s.oneOf[%d]" $name $idx))
|
||||||
|
}}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ return $additional_objects }}
|
{{ return $additional_objects }}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
{{ $property := partial "json-schema/resolve-allof" $property }}
|
{{ $property := partial "json-schema/resolve-allof" $property }}
|
||||||
{{ $type := $property.type }}
|
{{ $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 }}
|
{{ $type = partial "type-or-title" $property }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
{{ $types := slice }}
|
{{ $types := slice }}
|
||||||
|
|
||||||
{{ range .oneOf }}
|
{{ range .oneOf }}
|
||||||
{{ $types = $types | append .type }}
|
{{ $types = $types | append (partial "type-or-title" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $type = delimit $types "|" }}
|
{{ $type = delimit $types "|" }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue