<p dir="ltr">I will add this to next meeting's agenda. Things to think by the time of the meeting so we can vote on those:</p>
<p dir="ltr">- bike-shedding about parameters names (I'll attach screenshots of the API docs using three different conventions so it gets clearer.<br>
- Possibly missing terminology to add to the wiki.<br>
- Make it explicit that the terminology wiki conforms a guideline and not just a bike-shedding place.</p>
<p dir="ltr">Regards</p>
<br><div class="gmail_quote"><div dir="ltr">El vie., 24 de mar. de 2017 2:11 PM, Barton Chittenden <<a href="mailto:barton@bywatersolutions.com">barton@bywatersolutions.com</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Do we have any conventions for snake_case vs. notsnakecase?<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I don't see that in <a href="https://wiki.koha-community.org/wiki/Terminology" class="gmail_msg" target="_blank">https://wiki.koha-community.org/wiki/Terminology</a>, although it may be somewhere else in the coding guidelines.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">[This is probably bike-shedding that's been discussed elsewhere; please don't let me derail the discussion].</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">--B</div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Fri, Mar 24, 2017 at 10:34 AM, Jonathan Druart <span dir="ltr" class="gmail_msg"><<a href="mailto:jonathan.druart@bugs.koha-community.org" class="gmail_msg" target="_blank">jonathan.druart@bugs.koha-community.org</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi,<div class="gmail_msg">We definitely have to follow <a href="https://wiki.koha-community.org/wiki/Terminology" class="gmail_msg" target="_blank">https://wiki.koha-community.org/wiki/Terminology</a></div><div class="gmail_msg">In addition we should try and generate the DB schema of our dreams (regarding naming only!). That way we could have the REST API using it already while the code will be moving slowly in this direction.</div><div class="gmail_msg">That should be a team work, but driven first by few fellows to provide a first draft.</div><div class="gmail_msg">Cheers,</div><div class="gmail_msg">Jonathan<div class="gmail_msg"><div class="m_-4200948170133951855h5 gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Fri, 24 Mar 2017 at 10:23 Taskula Lari <<a href="mailto:lari.taskula@jns.fi" class="gmail_msg" target="_blank">lari.taskula@jns.fi</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello fellow Koha devs,<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
As the REST API is moving forward, me and Tomás had a discussion on<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
parameter and object property naming convention and how we should expose<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
column names to API consumers. Since we have already renamed multiple<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
objects in Koha (e.g. borrowers -> patrons, branches -> libraries etc),<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
we should discuss naming convention in REST API and maintain a<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
consistency throughout.<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
For those who have not been following REST API development, I will<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
quickly brief the current method that most REST API patches in Bugzilla<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
have implemented: The endpoint name in most cases uses name of the<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
corresponding Koha-object, for example /api/v1/patrons, /api/v1/holds,<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
/api/v1/cities and so on. This is pretty clear. We then fetch one or<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
more rows from the database via Koha-objects and simply convert them<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
into JSON.<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
The issue is that many of our database tables have inconsistency between<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
column names and the Koha-object names - meaning that currently<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
/api/v1/patrons returns a borrowernumber, /api/v1/holds a reserve_id and<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
so on. The API user does not care how we internally call our objects and<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
its parameters but only wants to see a clear and consistent naming<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
convention. Therefore /api/v1/patrons should return a "patron_id",<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
"library_id".<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
Do we want this? What about implementation, how do we want Koha-objects<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
to work with this? Koha::Object currently contains a TO_JSON method that<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
could be suitable for outputting renamed keys. What about input when the<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
keys are renamed, how do we want to convert them back? Any other<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
comments or ideas?<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
Lari Taskula<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
Koha-Suomi Oy<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
_______________________________________________<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
Koha-devel mailing list<br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<a href="mailto:Koha-devel@lists.koha-community.org" class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg" target="_blank">Koha-devel@lists.koha-community.org</a><br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
website : <a href="http://www.koha-community.org/" rel="noreferrer" class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg" target="_blank">http://www.koha-community.org/</a><br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
git : <a href="http://git.koha-community.org/" rel="noreferrer" class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg" target="_blank">http://git.koha-community.org/</a><br class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg">
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" class="m_-4200948170133951855m_-8838357084602593784gmail_msg gmail_msg" target="_blank">http://bugs.koha-community.org/</a></blockquote></div></div></div></div></div>
<br class="gmail_msg">_______________________________________________<br class="gmail_msg">
Koha-devel mailing list<br class="gmail_msg">
<a href="mailto:Koha-devel@lists.koha-community.org" class="gmail_msg" target="_blank">Koha-devel@lists.koha-community.org</a><br class="gmail_msg">
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br class="gmail_msg">
website : <a href="http://www.koha-community.org/" rel="noreferrer" class="gmail_msg" target="_blank">http://www.koha-community.org/</a><br class="gmail_msg">
git : <a href="http://git.koha-community.org/" rel="noreferrer" class="gmail_msg" target="_blank">http://git.koha-community.org/</a><br class="gmail_msg">
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" class="gmail_msg" target="_blank">http://bugs.koha-community.org/</a><br class="gmail_msg"></blockquote></div><br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
Koha-devel mailing list<br class="gmail_msg">
<a href="mailto:Koha-devel@lists.koha-community.org" class="gmail_msg" target="_blank">Koha-devel@lists.koha-community.org</a><br class="gmail_msg">
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br class="gmail_msg">
website : <a href="http://www.koha-community.org/" rel="noreferrer" class="gmail_msg" target="_blank">http://www.koha-community.org/</a><br class="gmail_msg">
git : <a href="http://git.koha-community.org/" rel="noreferrer" class="gmail_msg" target="_blank">http://git.koha-community.org/</a><br class="gmail_msg">
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" class="gmail_msg" target="_blank">http://bugs.koha-community.org/</a></blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div style="color:rgb(117,117,117);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:12.8px">Tomás Cohen Arazi</div><div style="color:rgb(117,117,117);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:12.8px">Theke Solutions (<a href="http://theke.io/">https://theke.io</a>)<br>✆ +54 9351 3513384<br>GPG: B2F3C15F</div></div></div>