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

Action schema defines links inconsistently with Thing Description #324

Open
rwb27 opened this issue Aug 10, 2023 · 0 comments
Open

Action schema defines links inconsistently with Thing Description #324

rwb27 opened this issue Aug 10, 2023 · 0 comments

Comments

@rwb27
Copy link
Contributor

rwb27 commented Aug 10, 2023

Thing Description defines the links property of a Thing to be an array of objects, each with "rel" and "href" properties (among others). Would it make sense for Actions to follow suit? This isn't a normative part of the spec, but it would feel quite sensible. It would mean changing from:

{
  "status": "completed",
  "output": true,
  "links": {
    "self": {
      "href": "https://my_host/actions/id"
    }
  }
}

to

{
  "status": "completed",
  "output": true,
  "links": [
    {"rel": "self", "href":"https://my_host/actions/id"},
  ]
}

The resulting object is slightly less convenient (I can't just do action["links"]["self"]["href"]) but it is more in keeping with the standard.

This is really a decision for LabThings-FastAPI, but I'm keen not to break compatibility if there was a good reason for doing it the current way.

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