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

Fix property type resolution in render-object-table #1789

Merged
merged 2 commits into from Apr 16, 2024

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Apr 16, 2024

The split was not clear between property-type and type-or-title, so it was not obvious which partial should be called for recursion. That resulted in an error where type-or-title was only called for objects and array items, even if it also resolves arrays of types.

This makes the split clearer. property-type must be called for any schema, and object-type-or-title is only called for object schemas.

This fixes some rendering in the CS API, for example the displayname of m.room.member:

Before:

image

After:

image

Also the value of a PushCondition:

Before:

image

After:

image

Preview: https://pr1789--matrix-spec-previews.netlify.app

The split was not clear between property-type and type-or-title,
so it was not obvious which partial should be called for recursion.
That resulted in an error where type-or-title was only called for objects and array items, even if it also resolves
arrays of types.

This makes the split clearer. property-type must be called for any schema,
and object-type-or-title is only called for object schemas.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner April 16, 2024 15:16
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@richvdh richvdh merged commit f4e7b2a into matrix-org:main Apr 16, 2024
12 checks passed
@zecakeh zecakeh deleted the object-table-type branch April 16, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants