рдПрдХ рдкреНрд░рдХрд╛рд░ | рдХреАрд╡рд░реНрдб | рдЙрджрд╛рд╣рд░рдг / рд╡рд┐рд╡рд░рдг |
---|
"рдХреАрд╡рд░реНрдб" рдпреЛрдЬрдирд╛ рдХрд╛ рд╡рд░реНрдгрди рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП | "$schema" | "$schema": http:
рдпреЛрдЬрдирд╛ рдХреЗ рдкреНрд░рд╛рд░реВрдк рд╕рдВрд╕реНрдХрд░рдг рдХреЛ рд╕реЗрдЯ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдЙрдкрдпреЛрдЧ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред |
"$id"
| "$id": "http://archi-blair.com/schemas/RolesDictionaryDef.json#"
рдПрдХ рджрд╕реНрддрд╛рд╡реЗрдЬрд╝ рдпрд╛ рдЙрд╕рдХреЗ рдЙрдк-рдкрд░рд┐рдкрде рдХреЗ рд▓рд┐рдП рдПрдХ рд╡рд┐рд╢рд┐рд╖реНрдЯ рдкрд╣рдЪрд╛рдирдХрд░реНрддрд╛ рдХреЛ рдЗрдВрдЧрд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдЙрдкрдпреЛрдЧ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред |
"title" "description" "examples" "comment"
| {
"title": "JSON schema for dictionary",
"description": " ",
"examples": ["user", "manager"],
"comment": " ))"
}
|
рд╕рд╛рдорд╛рдиреНрдп "рд╕рддреНрдпрд╛рдкрди рдХреАрд╡рд░реНрдб" рдЖрдЗрдЯрдо рдбреЗрдЯрд╛ рдкреНрд░рдХрд╛рд░ рд╕реЗ рд╕реНрд╡рддрдВрддреНрд░ рд╣реИ | "enum" | {"enum": [ "administrator", "superuser" ]}
рдХрдо рд╕реЗ рдХрдо 1 рдорд╛рди рд╕реЗ рдорд┐рд▓рд╛рди рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдПрдХ рдЪреЗрдХ рдмрдирд╛рдпрд╛ рдЧрдпрд╛ рд╣реИред
|
"const" | {"const": "user" }
рд╕реЗрдЯ рдорд╛рди рдХреЗ рд╕рд╛рде рд╕рдЯреАрдХ рдЕрдиреБрдкрд╛рд▓рди рдХреЗ рд▓рд┐рдП рдПрдХ рдЪреЗрдХ рдмрдирд╛рдпрд╛ рдЧрдпрд╛ рд╣реИред
|
"type" | {"type": ["number", "string", "null", "boolean"]}
{"type": "array"}
рд╕реНрдХреАрдорд╛ рджреНрд╡рд╛рд░рд╛ рдЙрдкрдпреЛрдЧ рдХрд┐рдП рдЬрд╛рдиреЗ рд╡рд╛рд▓реЗ рдбреЗрдЯрд╛ рдХреЗ рдкреНрд░рдХрд╛рд░ рдХреЛ рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдХрд░рддрд╛ рд╣реИред рдпрд╣ рдХреАрд╡рд░реНрдб рд╡реИрдХрд▓реНрдкрд┐рдХ рд╣реИ, рдФрд░ рдХреАрд╡рд░реНрдб рдорд╛рди рдПрдХ рд╕реНрдЯреНрд░рд┐рдВрдЧ рд╣реЛ рд╕рдХрддрд╛ рд╣реИ рдЬреЛ рдорд╛рдиреНрдп рдбреЗрдЯрд╛ рдкреНрд░рдХрд╛рд░ рдХрд╛ рдкреНрд░рддрд┐рдирд┐рдзрд┐рддреНрд╡ рдХрд░рддрд╛ рд╣реИ рдпрд╛ рдорд╛рдиреНрдп рдбреЗрдЯрд╛ рдкреНрд░рдХрд╛рд░реЛрдВ рдХрд╛ рдкреНрд░рддрд┐рдирд┐рдзрд┐рддреНрд╡ рдХрд░рддрд╛ рд╣реИред
|
Keywords, , | "type": "string"
minLength maxLength pattern contentEncoding contentMediaType
| {
"type": "string",
"minLength": 3,
"maxLength": 10,
"pattern": "^test\\/[a-z-]+$",
"contentEncoding": "base64",
"contentMediaType": "application/json"
}
.
|
"type": "number" "type": "integer"
minimum exclusiveMinimum maximum exclusiveMaximum multipleOf
| {
"type": "number",
"minimum": 1.5,
"exclusiveMinimum": true,
"maximum": 12.3,
"exclusiveMaximum": true,
"multipleOf": 0.5
}
.
|
"type": "object"
properties required dependencies minProperties maxProperties propertyNames patternProperties additionalProperties
|
"employees": {
"description": "",
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": ["employee"],
"enumNames": [""]
},
"enabled": {
"type": "boolean",
"default": true
}
},
"additionalProperties": false
}
}
, ( ).
|
"type": "array"
minItems maxItems uniqueItems contains items additionalItems
|
"employees": {
"description": "",
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": ["employee"],
"enumNames": [""]
},
"enabled": {
"type": "boolean",
"default": true
}
},
"additionalProperties": false
}
}
, ( ).
|
"type": "boolean"
| {"type": "boolean"}
boolean (true false).
|
"type": "null"
| {"type": "null"}
null ┬л┬╗ .
|
"type": "____" "format": "____"
| {
"type": "string",
"format": "date"
}
format . , .. -, , , .
|
"type": "____" "default": "____"
| {
"enabled": {
"type": "boolean",
"default": true
}
.
, .
|
| "not" "if-then-else"
| {
"not": {
"type": "string"
}
}
, .
|
, | "anyOf" "oneOf" "allOf"
| {
"type": "string",
"anyOf": [
{"const": "user"},
{"const": "manager" }
]
}
, .
|
, | "$id" "$ref" | RolesDictionaryDef.json:
{
"$id": http:
}
1 $ref ( ):
"items": {
"type": "object",
"minLength": 1,
"properties": {
"name": {
"description": " ",
"type": "string"
},
"description": {
"description": " ",
"type": "string"
},
"dictionaryGroup": {
"$ref": "RolesDictionaryDef.json#/definitions/roles"
}
},
"additionalProperties": false
}
2 JSON. , $ref .
|
"$ref" "definitions" | "$ref": "#/definitions/roles" , ┬лdefinitions┬╗:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": " ",
"type": "object",
"properties": {
"dictionaries": {
"description": "",
"type": "array",
"maxItems": 1,
"items": {
"type": "object",
"minLength": 1,
"properties": {
"name": {
"description": " ",
"type": "string",
"enum": [
"Roles Dictionary"
]
}
"dictionaryGroups": {
"$ref": "#/definitions/roles",
"description": " "
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false,
"definitions": {
"roles": {
"description": "",
"type": "object",
"properties": {
"administrators": {
"description": "",
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": [
"administrator",
"superuser"
],
"enumNames": [
"",
"- "
]
},
"enabled": {
"type": "boolean",
"default": true
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
},
"$id": "http://archi-blair.com/schemas/RolesDictionaryDef.json#"
}
, . $ref definitions.
|
"$ref" .
| "$ref": " #/definitions/roles"
"$ref": "RolesDictionaryDef.json#/definitions/roles"
, . , .
|