Closed benfrancis closed 6 years ago
I think if we don't want the POST to be redundant, it should be specified that:
name
are accepted, and/orname: {}
wrapper need not be included when doing POST /actions/name
Alternatively, we could just get rid of one of the POST requests.
I've addressed the review comments.
Only actions for that name are accepted, and/or
I went for this option to try to keep some consistency between HTTP requests and with the WebSocket API which always specifies an action type in an action request.
If another action type is requested, the server should respond with 400 Bad Request
.
@benfrancis That sounds good. I still had the one comment about the missing timeCompleted
, but otherwise I'm fine with this.
Yep I fixed that one too (once I'd figured out which branch I was meant to be pushing to!)
I've made an attempt to define separate Action, Event and Properties resources as discussed in #82.
I've realised that's there's also technically a separate ActionRequest resource for an individual action request (vs. the Action resource which is a queue of requests for a single action, the Event resource is an event log for a particular event).
This leaves us with separate Properties/Property, Actions/Action/ActionRequest and Events/Event resources and defines where the URLs for each of these resources can be defined.
There are few quirks here (like the separate ActionRequest resource), so feedback is welcome.
You can see a live version at https://benfrancis.github.io/wot/