matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
171 stars 91 forks source link

`/media/v3/preview_url` response spec should include more properties #1753

Open cperrin88 opened 3 months ago

cperrin88 commented 3 months ago

Link to problem area: https://github.com/matrix-org/matrix-spec/blob/0b43b5a343f19ceea1b141fc0dd9be7227ba7454/data/api/client-server/content-repo.yaml#L774-L783

Issue The /media/v3/preview_url endpoint spec includes only the matrix:image:size and the og:image properties. This means that clients that are based purely on the OpenAPI export, don't expose other OpenGraph properties beyond the image.

Expected behaviour The spec should contain at least the following properties as optional:

With these properties it is possible to create a useful preview with more than just the image.

OpenGraph: https://ogp.me/

richvdh commented 2 months ago

@cperrin88 is this causing a problem in the rendered output? If so, please could you link to the part of the spec that is incorrect? Or is the effect limited to the OpenAPI data?

cperrin88 commented 2 months ago

I'd say that's up for discussion. I think that the addtional fields might be helpful in the docs as a reference for what might be returned. The more important part for me is the OpenAPI spec. Any client that is created from this spec will not be able to display anything apart from the image data unless manually modified.

richvdh commented 2 months ago

Without a link to the spec doc, I'll be honest that it's unlikely to get much attention.

If you have strong opinions, feel free to open a PR which we can use as a basis for discussion.

cperrin88 commented 2 months ago

What do mean with a link? I thought I had linked all the relevant things.

I'd be willing to open a PR. Where would be the best place to ask questions since I am not familiar with the repo?

clokep commented 2 months ago

The rendered link: https://spec.matrix.org/v1.10/client-server-api/#get_matrixmediav3preview_url

richvdh commented 2 months ago

I'd be willing to open a PR. Where would be the best place to ask questions since I am not familiar with the repo?

Thanks! The Matrix Spec & Docs Authoring room is the best place to discuss updates to the matrix-spec repo.