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

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

Open
cperrin88 opened this issue Mar 19, 2024 · 6 comments
Open

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

cperrin88 opened this issue Mar 19, 2024 · 6 comments
Labels
A-Client-Server Issues affecting the CS API clarification An area where the expected behaviour is understood, but the spec could do with being more explicit

Comments

@cperrin88
Copy link

Link to problem area:

properties:
matrix:image:size:
type: integer
format: int64
description: The byte-size of the image. Omitted if there is no image attached.
og:image:
type: string
format: uri
description: An [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to
the image. Omitted if there is no image.

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:

  • og:title
  • og:type
  • og:url
  • og:description

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

OpenGraph: https://ogp.me/

@cperrin88 cperrin88 added the spec-bug Something which is in the spec, but is wrong label Mar 19, 2024
@turt2live turt2live added clarification An area where the expected behaviour is understood, but the spec could do with being more explicit A-Client-Server Issues affecting the CS API and removed spec-bug Something which is in the spec, but is wrong labels Mar 22, 2024
@richvdh
Copy link
Member

richvdh commented Apr 9, 2024

@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
Copy link
Author

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
Copy link
Member

richvdh commented Apr 9, 2024

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
Copy link
Author

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
Copy link
Member

clokep commented Apr 9, 2024

@richvdh
Copy link
Member

richvdh commented Apr 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client-Server Issues affecting the CS API clarification An area where the expected behaviour is understood, but the spec could do with being more explicit
Projects
None yet
Development

No branches or pull requests

4 participants