Fix enum types in JSON schemas (#1634)

`type: enum` does not exist, as an enum can be of any type.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
pull/1637/head^2
Kévin Commaille 1 year ago committed by GitHub
parent f11c5600a2
commit 5672bdbab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1 @@
Fix enum types in JSON schemas.

@ -15,7 +15,7 @@ type: object
title: m.login.sso flow schema
properties:
type:
type: enum
type: string
enum: ["m.login.sso"]
description: The string `m.login.sso`
example: "m.login.sso"

@ -31,7 +31,7 @@ allOf:
- type: object
properties:
edu_type:
type: enum
type: string
enum: ['m.device_list_update']
description: The string `m.device_list_update`.
example: "m.device_list_update"

@ -23,7 +23,7 @@ allOf:
- type: object
properties:
edu_type:
type: enum
type: string
enum: ['m.direct_to_device']
description: The string `m.direct_to_device`.
example: "m.direct_to_device"

@ -21,7 +21,7 @@ allOf:
- type: object
properties:
edu_type:
type: enum
type: string
enum: ['m.presence']
description: The string `m.presence`
example: "m.presence"
@ -44,7 +44,7 @@ allOf:
description: The user ID this presence EDU is for.
example: "@john:matrix.org"
presence:
type: enum
type: string
enum: ['offline', 'unavailable', 'online']
description: The presence of the user.
example: "online"

@ -24,7 +24,7 @@ allOf:
- type: object
properties:
edu_type:
type: enum
type: string
enum: ['m.receipt']
description: The string `m.receipt`
example: "m.receipt"

@ -23,7 +23,7 @@ allOf:
- type: object
properties:
edu_type:
type: enum
type: string
enum: ['m.signing_key_update']
description: The string `m.signing_update`.
example: "m.signing_key_update"

@ -20,7 +20,7 @@ allOf:
- type: object
properties:
edu_type:
type: enum
type: string
enum: ['m.typing']
description: The string `m.typing`
example: "m.typing"

@ -53,13 +53,6 @@
{{ $type = delimit (slice "[" $inner_type "]") "" }}
{{ end }}
{{/*
If the property is an enum, indicate this.
*/}}
{{ if (and (eq $property.type "string") ($property.enum)) }}
{{ $type = "enum" }}
{{ end }}
{{/*
Handle two ways of indicating "required", one for simple parameters,
the other for request and response body objects.
@ -72,7 +65,7 @@
<td>
{{ if $required }}<strong>Required: </strong>{{end -}}
{{ $property.description | markdownify -}}
{{ if eq $type "enum"}}<p>One of: <code>[{{ delimit $property.enum ", " }}]</code>.</p>{{ end -}}
{{ if $property.enum }}<p>One of: <code>[{{ delimit $property.enum ", " }}]</code>.</p>{{ end -}}
{{ if (index $property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $property "x-addedInMatrixVersion")) }}{{ end -}}
{{ if (index $property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $property "x-changedInMatrixVersion")) }}{{ end -}}
</td>

Loading…
Cancel
Save