v2 - "readOnly" key should be used in schemas

If it has a value of boolean true,
    this keyword indicates that the instance property SHOULD NOT be changed,
    and attempts by a user agent to modify the value of this property are expected to be rejected by a server.
    The value of this keyword MUST be a boolean.
    The default value is false.

    Further link for reference: http://json-schema.org/latest/json-schema-hypermedia.html#anchor15

Closes-Bug: #1521581
Depends-On: I279fba4099667d193609a31259057b897380d6f0
Change-Id: I96717506259c0d28500b8747369c47029b1dd9b6
This commit is contained in:
zwei
2016-01-18 10:17:14 +08:00
parent b4da8ce5f3
commit 22e3bf0234
7 changed files with 58 additions and 33 deletions
+2 -1
View File
@@ -112,7 +112,8 @@ class TestUtils(testtools.TestCase):
def schema_getter(_type='string', enum=False):
prop = {
'type': ['null', _type],
'description': 'Test schema (READ-ONLY)',
'readOnly': True,
'description': 'Test schema',
}
if enum: