davidjsherman / inirobot-scratch-thymioII

Link Scratch 2 and the Thymio-II robot
7 stars 2 forks source link

Add GET path template for slot update using RFC 6570 § 2.4.2 #15

Open davidjsherman opened 8 years ago

davidjsherman commented 8 years ago

The REST verb for slot update is properly POST. However the Scratch protocol requires GET for all requests. So asebahttp accepts GET requests for slot update, with the value vector encoded in the URI separated by slashes. This variant needs to be documented in the api-docs.

Since OAS uses RFC 6570 path templates, in the general case we can use a composite value and rely on convention to encode the values: Q_set_odometer{/values*}.

When the slot is an event and we know the parameter names, we can instead expand the values explicitly: Q_set_odometer/{angle}/{x}/{y}.

davidjsherman commented 8 years ago

Fixed for variables in a944eef.