From 70cb95394df9cddca3ed6fc18b2711892c879167 Mon Sep 17 00:00:00 2001 From: Sergey Nikitin Date: Fri, 5 Feb 2016 15:12:13 +0300 Subject: [PATCH] Added tags restrictions to the tagging guidelines One problem with tag names was found during tag implementation in Nova Ibc44228aeae94c17353af7fccfcfb2c11b2e9190 This problems was connected with URLs. We can't use '/' in names because in this case we will get a incorrect URL for tag 'abc/cba': /servers//tags/abc/cba Even if '/' will be encoded like %2F. Nova will decide that it is '/'. But this is not a problem of Nova. Unfortunately some servers works incorrectly with encoded character '/'. It's a problem of poor implementation of some servers. To escape problems with handling URLs character '/' should be forbidden in tag names. Change-Id: I9832270b3d8210bff9cd2d9732b4d19f757f865a --- guidelines/tags.rst | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/guidelines/tags.rst b/guidelines/tags.rst index 707adab..e7a22af 100644 --- a/guidelines/tags.rst +++ b/guidelines/tags.rst @@ -18,8 +18,7 @@ Tags Representation ------------------- Tags are strings attached to an entity with the purpose of classification into -groups. To simplify requests that specify lists of tags, the comma character -is not allowed to be in a tag name. +groups. An entity can have zero, one or more tags associated with it, for that reason the recommended representation within the parent entity is a list. @@ -51,6 +50,25 @@ For resources that have a representation that is not in JSON a separate endpoint must be created to expose the tags. See the "Tag Resource URLs" section below for more information. +Tags Restrictions +----------------- + +Tags are strings with the following basic restrictions: + +* Tags are case sensitive. +* '/' is **not** allowed to be in a tag name +* Comma is **not** allowed to be in a tag name in order to simplify requests + that specify lists of tags +* All other characters are allowed to be in a tag name + +.. note:: + + The '/' character is forbidden because some servers have a problem with + encoding this character. The problem is that the server will handle '%2F' + as '/' even though '/' is encoded. It's a problem of poor server + implementation. To avoid problems with handling URLs character '/' is + forbidden in tag names. + Character Encoding for Tags ---------------------------