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

Observations are not sorted #5

Open
ridoo opened this issue Jan 26, 2025 · 0 comments
Open

Observations are not sorted #5

ridoo opened this issue Jan 26, 2025 · 0 comments

Comments

@ridoo
Copy link
Member

ridoo commented Jan 26, 2025

GETting observations from a datastream responds with an unsorted list of obserations. How is sorting solved or could be enforced in connecting-systems? (I think one could not always rely on resultTime, right?)

GET /datastreams/a0288287-b14d-30f5-901f-fb65fc9f9bc6/observations?f=application%2Fjson

```json
{
  "items": [
    {
      "id": "fa60ff6a-4b6a-4c83-96d4-4490aa40207c",
      "datastream@id": "a0288287-b14d-30f5-901f-fb65fc9f9bc6",
      "resultTime": "2024-10-02T14:30:00+00:00",
      "result": 10.4
    },
    {
      "id": "212c3fc5-8167-4c45-9c81-b165ae0d9720",
      "datastream@id": "a0288287-b14d-30f5-901f-fb65fc9f9bc6",
      "resultTime": "2024-10-02T16:40:00+00:00",
      "result": 10.4
    },
    {
      "id": "99e58d21-78bc-4d10-a4c2-16a92a49748e",
      "datastream@id": "a0288287-b14d-30f5-901f-fb65fc9f9bc6",
      "resultTime": "2024-09-29T14:30:00+00:00",
      "result": 10.9
    },
    {
      "id": "ea0c98ed-ca9e-4a7b-b0aa-2112b5979ed5",
      "datastream@id": "a0288287-b14d-30f5-901f-fb65fc9f9bc6",
      "resultTime": "2024-09-29T22:20:00+00:00",
      "result": 11
    }
}

BTW: Within links, including UUID-ID in path and query parameter is redundant. I'd prefer it in the URL path instead of the query parameter -- are there cases where query parameter is preferred?

"links": [
  {
    "title": "next",
    "rel": "next",
    "href": "https://<base_url>/datastreams/a0288287-b14d-30f5-901f-fb65fc9f9bc6/observations?f=application%2Fjson&limit=10&offset=20&datastream=a0288287-b14d-30f5-901f-fb65fc9f9bc6"
  }
]
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

No branches or pull requests

1 participant