Skip to content

Commit d20ba6f

Browse files
committed
Move "readOnly" from Hyper-Schema to Validation
We move the description and schema definition of "readOnly" verbatim from the Hyper-Schema specification (and meta-schema) to the validation one, in the "Metadata keywords" section (along with "default", in particular). This addresses part of #363, which states that some keywords historically in the Hyper-Schema specification would be better in the Validation document. The main argument for moving keywords such as "readOnly" is that the Hyper-Schema document could then only focus on describing the hypermedia linking model.
1 parent 0b67e5c commit d20ba6f

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

hyper-schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@
115115
"type": "string"
116116
}
117117
}
118-
},
119-
"readOnly": {
120-
"description": "If true, indicates that the value of this property is controlled by the server.",
121-
"type": "boolean",
122-
"default": "false"
123118
}
124119
},
125120
"links": [

jsonschema-hyperschema.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -421,23 +421,6 @@
421421
</figure>
422422
</section>
423423
</section>
424-
425-
<section title="readOnly">
426-
<t>
427-
If it has a value of boolean true, this keyword indicates that the value of the
428-
instance is managed exclusively by the server or the owning authority, and
429-
attempts by a user agent to modify the value of this property are expected to be
430-
ignored or rejected by a server.
431-
</t>
432-
<t>
433-
For example, this property would be used to mark a server-generated serial
434-
number as read-only.
435-
</t>
436-
<t>
437-
The value of this keyword MUST be a boolean.
438-
The default value is false.
439-
</t>
440-
</section>
441424
</section>
442425

443426
<section title="Link Description Object">

jsonschema-validation.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,23 @@
740740
</t>
741741
</section>
742742

743+
<section title='"readOnly"'>
744+
<t>
745+
If it has a value of boolean true, this keyword indicates that the value of the
746+
instance is managed exclusively by the server or the owning authority, and
747+
attempts by a user agent to modify the value of this property are expected to be
748+
ignored or rejected by a server.
749+
</t>
750+
<t>
751+
For example, this property would be used to mark a server-generated serial
752+
number as read-only.
753+
</t>
754+
<t>
755+
The value of this keyword MUST be a boolean.
756+
The default value is false.
757+
</t>
758+
</section>
759+
743760
<section title='"examples"'>
744761
<t>
745762
The value of this keyword MUST be an array.

schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
"type": "string"
5858
},
5959
"default": {},
60+
"readOnly": {
61+
"description": "If true, indicates that the value of this property is controlled by the server.",
62+
"type": "boolean",
63+
"default": "false"
64+
},
6065
"multipleOf": {
6166
"type": "number",
6267
"exclusiveMinimum": 0

0 commit comments

Comments
 (0)