Skip to content

Commit 029de3f

Browse files
authored
Merge pull request #433 from handrews/secret
Add a "writeOnly" (formerly "secret") annotation
2 parents 9967bee + 8a368ed commit 029de3f

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

jsonschema-validation.xml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,28 +1241,49 @@
12411241
</t>
12421242
</section>
12431243

1244-
<section title='"readOnly"'>
1244+
<section title='"readOnly" and "writeOnly"'>
12451245
<t>
1246-
The value of this keyword MUST be a boolean. When multiple occurrences
1247-
of this keyword are applicable to a single sub-instance, the resulting
1246+
The value of these keywords MUST be a boolean. When multiple occurrences
1247+
of these keywords are applicable to a single sub-instance, the resulting
12481248
value MUST be true if any occurrence specifies a true value, and MUST
12491249
be false otherwise.
12501250
</t>
12511251
<t>
1252-
If it has a value of boolean true, this keyword indicates that the value
1252+
If "readOnly" has a value of boolean true, it indicates that the value
12531253
of the instance is managed exclusively by the owning authority, and
12541254
attempts by an application to modify the value of this property are
12551255
expected to be ignored or rejected by that owning authority.
12561256
</t>
12571257
<t>
1258-
For example, this property would be used to mark a database-generated serial
1259-
number as read-only.
1258+
An instance document that is marked as "readOnly for the entire document
1259+
MAY be ignored if sent to the owning authority, or MAY result in an
1260+
error, at the authority's discretion.
12601261
</t>
12611262
<t>
1262-
This keyword can be used to assist in user interface instance generation.
1263+
If "writeOnly" has a value of boolean true, it indicates that the value
1264+
is never present when the instance is retrieved from the owning authority.
1265+
It can be present when sent to the owning authority to update or create
1266+
the document (or the resource it represents), but it will not be included
1267+
in any updated or newly created version of the instance.
12631268
</t>
12641269
<t>
1265-
Omitting this keyword has the same behavior as a value of false.
1270+
An instance document that is marked as "writeOnly" for the entire document
1271+
MAY be returned as a blank document of some sort, or MAY produce an error
1272+
upon retrieval, or have the retrieval request ignored, at the authority's
1273+
discretion.
1274+
</t>
1275+
<t>
1276+
For example, "readOnly" would be used to mark a database-generated serial
1277+
number as read-only, while "writeOnly" would be used to mark a password
1278+
input field.
1279+
</t>
1280+
<t>
1281+
These keywords can be used to assist in user interface instance generation.
1282+
In particular, an application MAY choose to use a widget that hides
1283+
input values as they are typed for write-only fields.
1284+
</t>
1285+
<t>
1286+
Omitting these keywords has the same behavior as values of false.
12661287
</t>
12671288
</section>
12681289

@@ -1390,6 +1411,7 @@
13901411
<t>Warn of possibly removing "dependencies" in the future</t>
13911412
<t>Grouped validation keywords into sub-sections for readability</t>
13921413
<t>Moved "readOnly" from hyper-schema to validation meta-data</t>
1414+
<t>Added "writeOnly"</t>
13931415
<t>Added string-encoded media section, with former hyper-schema "media" keywords</t>
13941416
<t>Restored "regex" format (removal was unintentional)</t>
13951417
<t>Added "date" and "time" formats, and reserved additional RFC 3339 format names</t>

0 commit comments

Comments
 (0)