[Koha-devel] ID's in RESTful bodies

Renvoize, Martin martin.renvoize at ptfs-europe.com
Wed Oct 19 22:41:29 CEST 2016


A few of us(1) got together for a short 'Hangout' to talk about RESTful
best practices today with the idea of debating out some best practices
before presenting them to the wider group here and in the next irc dev
meeting to add to the coding guidelines.

In this short hangout we discussed "ID's in request bodies". It's a
contentious issue in lots of RESTful circles, so we thought it worth
getting into a coding guideline sooner rather than later to make sure we're
consistent.

TL:DR: Use the Swagger attribute 'readOnly' on id fields. This means id's
are encouraged in responses but are banned in requests.

There are lots of camps on this one, but the important thing is to be
consistent across the api endpoints and ensure it's well documented. The
swagger meaning of readOnly is well understood by rest users and thus
accounts for the 'well documented' side, and implementing it using the
Swagger plugin should mean minimal effort in ensuring it is consistent.

1) Jonathan D, Tomas C, Lari T, Kyle H and I

*Martin Renvoize*

Development Manager




*T:* +44 (0) 1483 378728

*F:* +44 (0) 800 756 6384

*E:* martin.renvoize at ptfs-europe.com

www.ptfs-europe.com



<https://www.ptfs-europe.com>



Registered in the United Kingdom No. 06416372   VAT Reg No. 925 7211 30

The information contained in this email message may be privileged,
confidential and protected from disclosure. If you are not the intended
recipient, any dissemination, distribution or copying is strictly
prohibited. If you think that you have received this email message in
error, please email the sender at info at ptfs-europe.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20161019/6ac11d57/attachment-0001.html>


More information about the Koha-devel mailing list