Skip to content

Commit

Permalink
update schema and input
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 10, 2024
1 parent b484476 commit 2f3715e
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 128 deletions.
90 changes: 78 additions & 12 deletions integration/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,85 @@
"inlineConfig": {
"foo": "bar"
},
"tags": ["foo", "bar"],
"receiver": [{
"title": "foo"
}],
"profileImage": "",
"read": true,
"source": {
"name": "Website",
"url": "https://www.google.com/"
"mapTags": {
"foo": "bar",
"bar": "foo"
},
"mapReceiver": [
{
"title": "foo",
"email": "[email protected]",
"categories": [
"foo",
"bar"
],
"locations": [
{
"lat": 51.5167,
"long": 9.9167
}
],
"origin": {
"lat": 51.5167,
"long": 9.9167
}
}
],
"tags": [
"foo",
"bar"
],
"receiver": [
{
"title": "foo",
"email": "[email protected]",
"categories": [
"foo",
"bar"
],
"locations": [
{
"lat": 51.5167,
"long": 9.9167
}
],
"origin": {
"lat": 51.5167,
"long": 9.9167
}
}
],
"read": true,
"author": {
"title": "foo"
"title": "foo",
"email": "[email protected]",
"categories": [
"foo",
"bar"
],
"locations": [
{
"lat": 51.5167,
"long": 9.9167
}
],
"origin": {
"lat": 51.5167,
"long": 9.9167
}
},
"meta": {
"foo": "bar"
},
"sendDate": "2024-11-10",
"readDate": "2024-11-10T11:52:00Z",
"price": 13.37,
"content": "foobar"
}
"rating": 1337,
"question": "foobar",
"content": "foobar",
"version": "foobar",
"coffeeTime": "11:52:00",
"g-recaptcha-response": "foobar",
"media.fields": "foobar",
"payload": "foobar"
}
173 changes: 57 additions & 116 deletions output/typeschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,203 +2,144 @@
"definitions": {
"Author": {
"description": "An simple author element with some description",
"type": "object",
"type": "struct",
"properties": {
"title": {
"type": "string",
"pattern": "[A-z]{3,16}"
"type": "string"
},
"email": {
"description": "We will send no spam to this address",
"nullable": true,
"type": "string"
"type": "string",
"nullable": true
},
"categories": {
"type": "array",
"items": {
"schema": {
"type": "string"
},
"maxItems": 8
}
},
"locations": {
"description": "Array of locations",
"type": "array",
"items": {
"$ref": "Location"
"schema": {
"type": "reference",
"target": "Location"
}
},
"origin": {
"$ref": "Location"
"type": "reference",
"target": "Location"
}
},
"required": [
"title"
]
}
},
"Location": {
"description": "Location of the person",
"type": "object",
"type": "struct",
"properties": {
"lat": {
"type": "number"
},
"long": {
"type": "number"
}
},
"required": [
"lat",
"long"
]
}
},
"Meta": {
"type": "object",
"additionalProperties": {
"type": "map",
"schema": {
"type": "string"
},
"minProperties": 1,
"maxProperties": 6
}
},
"News": {
"description": "An general news entry",
"type": "object",
"type": "struct",
"properties": {
"config": {
"$ref": "Meta"
"type": "reference",
"target": "Meta"
},
"inlineConfig": {
"type": "object",
"additionalProperties": {
"type": "map",
"schema": {
"type": "string"
}
},
"mapTags": {
"type": "map",
"schema": {
"type": "string"
}
},
"mapReceiver": {
"type": "map",
"schema": {
"type": "reference",
"target": "Author"
}
},
"tags": {
"type": "array",
"items": {
"schema": {
"type": "string"
},
"minItems": 1,
"maxItems": 6
}
},
"receiver": {
"type": "array",
"items": {
"$ref": "Author"
},
"minItems": 1
},
"resources": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "Location"
},
{
"$ref": "Web"
}
]
"schema": {
"type": "reference",
"target": "Author"
}
},
"profileImage": {
"format": "base64",
"type": "string"
},
"read": {
"type": "boolean"
},
"source": {
"oneOf": [
{
"$ref": "Author"
},
{
"$ref": "Web"
}
]
},
"author": {
"$ref": "Author"
"type": "reference",
"target": "Author"
},
"meta": {
"$ref": "Meta"
"type": "reference",
"target": "Meta"
},
"sendDate": {
"format": "date",
"type": "string"
"type": "string",
"format": "date"
},
"readDate": {
"format": "date-time",
"type": "string"
},
"expires": {
"format": "period",
"type": "string"
"type": "string",
"format": "date-time"
},
"price": {
"type": "number",
"minimum": 1,
"maximum": 100
"type": "number"
},
"rating": {
"type": "integer",
"minimum": 1,
"maximum": 5
"type": "integer"
},
"content": {
"description": "Contains the main content of the news entry",
"type": "string",
"minLength": 3,
"maxLength": 512
"type": "string"
},
"question": {
"enum": [
"foo",
"bar"
],
"type": "string"
},
"version": {
"const": "http:\/\/foo.bar",
"type": "string"
},
"coffeeTime": {
"format": "time",
"type": "string"
"type": "string",
"format": "time"
},
"profileUri": {
"format": "uri",
"g-recaptcha-response": {
"type": "string"
},
"g-recaptcha-response": {
"media.fields": {
"type": "string"
},
"payload": {
"type": "any"
}
},
"required": [
"receiver",
"price",
"content"
]
},
"Web": {
"description": "An application",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"name",
"url"
]
}
}
},
"$ref": "News"
"root": "News"
}

0 comments on commit 2f3715e

Please sign in to comment.