Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow null in room_types for POST /publicRooms endpoints #1564

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow `null` in `room_types` in `POST /publicRooms` endpoints schemas.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow `null` in `room_types` in `POST /publicRooms` endpoints schemas.
2 changes: 1 addition & 1 deletion data/api/client-server/list_public_rooms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ paths:
type: array
x-addedInMatrixVersion: "1.4"
items:
type: string
type: ["string", "null"]
description: |-
An optional list of [room types](/client-server-api/#types) to search
for. To include rooms without a room type, specify `null` within this
Expand Down
2 changes: 1 addition & 1 deletion data/api/server-server/public_rooms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ paths:
type: array
x-addedInMatrixVersion: "1.4"
items:
type: string
type: ["string", "null"]
description: |-
An optional list of [room types](/client-server-api/#types) to search
for. To include rooms without a room type, specify `null` within this
Expand Down
15 changes: 14 additions & 1 deletion layouts/partials/openapi/render-object-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,24 @@
internal structure, handle this with a bit of recursion
*/}}
{{ $type = delimit (slice "{string: " (partial "type-or-title" .additionalProperties) "}" ) "" }}
{{ else if and .oneOf (reflect.IsSlice .oneOf) }}
{{ else if reflect.IsSlice .type }}
{{/* It's legal to specify an array of types. Join them together in that case */}}

{{ $types := slice }}

{{ range .type }}
{{ $types = $types | append . }}
{{ end }}

{{ $type = delimit $types "|" }}
{{ else if and .oneOf (reflect.IsSlice .oneOf) }}
{{/*
This is like an array of types except some of the types probably have a schema.
Join them together too.
*/}}

{{ $types := slice }}

{{ range .oneOf }}
{{ $types = $types | append .type }}
{{ end }}
Expand Down