Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
finished recording 05_05
Browse files Browse the repository at this point in the history
  • Loading branch information
svodnik committed Jun 26, 2021
1 parent bc69772 commit aa9bf94
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions Ch05/05_05/begin/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,108 @@ var productSchema = {
]
}
};

var personSchema = {
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://hplussport.com/schemas/person.json",
"type": "object",
"title": "h+ Sport People",
"description": "Schema for h+ Sport person cards.",
"default": {},
"required": [
"cards"
],
"properties": {
"cards": {
"$id": "#/properties/cards",
"type": "array",
"title": "The cards schema",
"description": "An explanation about the purpose of this instance.",
"default": [],
"items": {
"$id": "#/properties/cards/items",
"anyOf": [
{
"$id": "#/properties/cards/items/anyOf/0",
"type": "object",
"title": "The first anyOf schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"required": [
"img",
"cardInfo",
"cardText"
],
"properties": {
"img": {
"$id": "#/properties/cards/items/anyOf/0/properties/img",
"type": "object",
"title": "The img schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"required": [
"src",
"alt"
],
"properties": {
"src": {
"$id": "#/properties/cards/items/anyOf/0/properties/img/properties/src",
"type": "string",
"title": "The src schema",
"description": "An explanation about the purpose of this instance.",
"default": ""
},
"alt": {
"$id": "#/properties/cards/items/anyOf/0/properties/img/properties/alt",
"type": "string",
"title": "The alt schema",
"description": "An explanation about the purpose of this instance.",
"default": ""
}
},
"additionalProperties": true
},
"cardInfo": {
"$id": "#/properties/cards/items/anyOf/0/properties/cardInfo",
"type": "object",
"title": "The cardInfo schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"required": [
"cardName",
"cardTitle"
],
"properties": {
"cardName": {
"$id": "#/properties/cards/items/anyOf/0/properties/cardInfo/properties/cardName",
"type": "string",
"title": "The cardName schema",
"description": "An explanation about the purpose of this instance.",
"default": ""
},
"cardTitle": {
"$id": "#/properties/cards/items/anyOf/0/properties/cardInfo/properties/cardTitle",
"type": "string",
"title": "The cardTitle schema",
"description": "An explanation about the purpose of this instance.",
"default": ""
}
},
"additionalProperties": true
},
"cardText": {
"$id": "#/properties/cards/items/anyOf/0/properties/cardText",
"type": "string",
"title": "The cardText schema",
"description": "An explanation about the purpose of this instance.",
"default": ""
}
},
"additionalProperties": true
}
]
}
}
},
"additionalProperties": true
};

0 comments on commit aa9bf94

Please sign in to comment.