Skip to content

Commit

Permalink
Switch from additionalProperties: {} to using a description
Browse files Browse the repository at this point in the history
  • Loading branch information
Johennes committed Jul 24, 2024
1 parent 20c109c commit de615f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion changelogs/client_server/newsfragments/1909.clarification
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The `UserIdentifier` object in `POST /_matrix/client/v3/login` can contain additional properties.
The `UserIdentifier` object in `POST /_matrix/client/v3/login` contains additional properties that depend on the identification type.
1 change: 0 additions & 1 deletion changelogs/internal/newsfragments/1909.clarification

This file was deleted.

7 changes: 5 additions & 2 deletions data/api/client-server/definitions/user_identifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ type: object
properties:
type:
type: string
description: The type of identification. See [Identifier types](/client-server-api/#identifier-types) for supported values and additional property descriptions.
description: |-
The type of identification. See [Identifier types](/client-server-api/#identifier-types)
for supported values and additional property descriptions.
required:
- type
additionalProperties: {}
additionalProperties:
description: Keys dependent on the identification type
8 changes: 3 additions & 5 deletions layouts/partials/openapi/render-object-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@

{{ end }}

{{/* Enforce `additionalProperties: {}` instead of the equivalent `additionalProperties: true` for easier processing */}}
{{ if eq .additionalProperties true }}
{{ errorf "Use `additionalProperties: {}` instead of `additionalProperties: true`" }}
{{ end }}

{{/*
If the object has additional properties *as well as* regular properties, we add a special row to the table.

Expand All @@ -72,6 +67,9 @@

TODO: support `patternProperties` here.
*/}}
{{ if eq .additionalProperties true }}
{{ errorf "`additionalProperties: true` is de facto the default for Matrix and doesn't provide any information" }}
{{ end }}
{{ if reflect.IsMap .additionalProperties }}

<tr>
Expand Down

0 comments on commit de615f5

Please sign in to comment.