alphagov/govuk_content_api — pull request #152 by JordanHatch (2014-01-21 16:30:15+00:00)
Title: Use the singular form of tag types in endpoints

This pull request makes two changes to endpoints in the Content API, with the aim of keeping the use of tag types consistent. Currently, a tag type (eg. 'section') may be referred to in both the singular and plural form depending on which endpoint you make a request to (eg. `/tags/sections/driving.json` vs `/with_tag.json?section=driving`). I think the case for consistent referencing of a tag outweighs the semantics of using the plural form in the URL. :smile:

The first change makes URLs for tags always use the singular form of the tag type (eg `/tags/section/driving.json`). A request made with the plural form of a valid tag type will be redirected to the singular type, to avoid breaking clients.

The second change deprecates the `/tags/.json` endpoint, in favour of using `/tags.json`. Both these endpoints performed the same function, using separate code, however the latter also includes the ability to sort tags and return child tags for any tag type. A request to `/tags/sections.json` (or `/tags/section.json`) will now be redirected to `/tags.json?type=section`.