Skip to content

Commit fed1f8c

Browse files
cconard96cedric-anne
authored andcommitted
hlapi use readOnly and writeOnly
1 parent 731f3b1 commit fed1f8c

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

‎source/devapi/hlapi/schemas.rst‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Let's look at a partial version of the schema definition for a User since it sho
4848
'type' => Doc\Schema::TYPE_INTEGER,
4949
'format' => Doc\Schema::FORMAT_INTEGER_INT64,
5050
'description' => 'ID',
51-
'x-readonly' => true,
51+
'readOnly' => true,
5252
],
5353
'username' => [
5454
'x-field' => 'name',
@@ -96,13 +96,13 @@ Let's look at a partial version of the schema definition for a User since it sho
9696
'type' => Doc\Schema::TYPE_STRING,
9797
'format' => Doc\Schema::FORMAT_STRING_PASSWORD,
9898
'description' => 'Password',
99-
'x-writeonly' => true,
99+
'writeOnly' => true,
100100
],
101101
'password2' => [
102102
'type' => Doc\Schema::TYPE_STRING,
103103
'format' => Doc\Schema::FORMAT_STRING_PASSWORD,
104104
'description' => 'Password confirmation',
105-
'x-writeonly' => true,
105+
'writeOnly' => true,
106106
],
107107
'picture' => [
108108
'type' => Doc\Schema::TYPE_STRING,
@@ -146,7 +146,7 @@ The full schema can be specified using the 'x-full-schema' field.
146146
The criteria for the join is specified in the 'x-join' field (more on that in the :ref:`Joins section <joins>`).
147147

148148
Users have two password fields which we would never want to show via the API, but we do want them to exist in the schema to allow setting/resetting a password.
149-
In this case, both 'password' and 'password2' have a 'x-writeonly' field present and set to true.
149+
In this case, both 'password' and 'password2' have a 'writeOnly' field present and set to true.
150150

151151
The last property shown, 'picture', is an example of a mapped property.
152152
In some cases, the data we want the user to see will differ from the raw value in the database.
@@ -243,10 +243,6 @@ Below is a complete list of supported extension fields/properties used in OpenAP
243243
- A callable that transforms the raw value specified by 'x-mapped-from' to the display value.
244244
- Schema properties
245245
- Debug mode only
246-
* - x-readonly
247-
- Specifies the property can only be read and not written to.
248-
- Schema properties
249-
- Yes
250246
* - x-rights-conditions
251247
- Array of arrays or callables that returns an array of SQL criteria for special visibility restrictions. Only 'read' restrictions are currently supported.
252248
The type of restriction should be specified as the array key, and the callable or array as the value.
@@ -258,7 +254,3 @@ Below is a complete list of supported extension fields/properties used in OpenAP
258254
Typically you would find all shared properties between the different schemas and use that as the properties for this shared schema.
259255
- Main schema
260256
- Debug mode only
261-
* - x-writeonly
262-
- Specifies the property can only be written to and not read.
263-
- Schema properties
264-
- Yes

0 commit comments

Comments
 (0)