Draft 07 - User Example
A schema demonstrating some draft 07 features
$id | draft-07-user.yml |
$schema | http://json-schema.org/draft-07/schema# |
Properties
Example
{
"username": "seymour_butz",
"password": "M0zT4v3rn"
}
username
Title |
Username |
Description |
This is a description |
Type | String |
Required |
Yes |
Read Only |
true |
Const |
seymour_butz |
password
Title |
Password |
Description |
A write only password property |
Type | String |
Required |
No |
Write Only |
true |
Schema
{
"$id": "draft-07-user.yml",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Draft 07 - User Example",
"description": "A schema demonstrating some draft 07 features",
"examples": [
{
"username": "seymour_butz",
"password": "M0zT4v3rn"
}
],
"required": [
"username"
],
"type": "object",
"properties": {
"username": {
"type": "string",
"title": "Username",
"const": "seymour_butz",
"readOnly": true,
"description": "This is a description",
"$comment": "This is a comment"
},
"password": {
"type": "string",
"title": "Password",
"writeOnly": true,
"description": "A write only password property"
}
}
}