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

Clarify parameter definition for third-party location lookups #1947

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

deepbluev7
Copy link
Contributor

@deepbluev7 deepbluev7 commented Sep 11, 2024

While 1405184 redefined most fields to be the appropriate object type, it missed one of them.

Signed-off-by: Nicolas Werner [email protected]

Pull Request Checklist

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

…meters

While 1405184 redefined most fields to
be the appropriate object type, it missed one of them.

Signed-off-by: Nicolas Werner <[email protected]>
@deepbluev7 deepbluev7 requested a review from a team as a code owner September 11, 2024 16:25
Signed-off-by: Nicolas Werner <[email protected]>
@richvdh richvdh changed the title Clarify that third-party location lookups use user-defined query para… Clarify that third-party location lookups use user-defined query parameters Oct 29, 2024
@richvdh
Copy link
Member

richvdh commented Nov 12, 2024

Sorry for the delay in reviewing this.

It took me a while to figure out what is going on here; but with reference to a previous discussion thread and the OpenAPI spec, I think I've figured it out. I'll write down my conclusions for the sake of future archaeologists (including myself).

As I understand it, this is replacing the searchFields query-parameter of the GET /_matrix/client/v3/thirdparty/location/{protocol}, which is a string, with a pseudo-parameter named fields, which is specified as an object.

The relevant part of the OpenAPI spec is the definition of the Parameter Object; in particular the rules for serialization of the parameter. The relevant OpenAPI fields are style (which is specified to default to form for query parameters) and explode (which defaults to true when style is form). The style examples table then gives an example serialization of R=100&G=200&B=150 for an object containing keys R, G and B.

[I now see that @deepbluev7 has reached much the same conclusion at https://github.com//issues/560#issuecomment-2344138695.]

It's worth noting that the name of the object parameter (fields) is never actually used in the API. AIUI, this is being changed from searchFields for consistency with the definitions of other, similar, APIs.

Looking at #560, and #1584, this appears to be a correct change.

@richvdh richvdh changed the title Clarify that third-party location lookups use user-defined query parameters Clarify parameter definition for third-party location lookups Nov 12, 2024
@richvdh richvdh enabled auto-merge (squash) November 12, 2024 22:24
@richvdh richvdh merged commit 9799b89 into matrix-org:main Nov 12, 2024
12 checks passed
@richvdh
Copy link
Member

richvdh commented Nov 12, 2024

I've opened #1993 to track the fact that the spec text makes a mess of this.

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.

3 participants