Use Case
To reduce latency and improve user experience, a single search endpoint should be available that returns results of a query that include relevant activities, disabilities, other filtered resource collections as one response.
Straw Man Proposal
Combining the results of the /activities and /sessions responses into one composite response keeps it consistent with each of the resource collection endpoints, however this also leads to confusion in several areas:
- Hydra views within the sessions list don't reference the composite endpoint, as they originate from the /sessions endpoint
- When filters reference properties via dot notation, it is not clear which properties are being referenced (e.g. is
location.geo inside sessions or activities?).
Example
GET /search/sessions?latitude=51.5&longitude=-0.2&radius=5
->
{
"@context": "https://www.openactive.io/ns/oa.jsonld",
"activity": {
"type": "Collection",
"id": "https://example.com/api/activities?latitude=51.5&longitude=-0.2&radius=5",
"totalItems": 32,
"items": []
},
"sessions": {
"@context": "https://www.openactive.io/ns/oa.jsonld",
"id": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5",
"type": "Collection",
"totalItems": 145,
"view": {
"id": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5",
"type": "PartialCollectionView",
"first": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5&page=1",
"next": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5&page=2",
"last": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5&page=3"
},
"items": []
}
}
Use Case
To reduce latency and improve user experience, a single search endpoint should be available that returns results of a query that include relevant activities, disabilities, other filtered resource collections as one response.
Straw Man Proposal
Combining the results of the /activities and /sessions responses into one composite response keeps it consistent with each of the resource collection endpoints, however this also leads to confusion in several areas:
location.geoinsidesessionsoractivities?).Example