Commit b905b80a authored by Xiaowu Zhang's avatar Xiaowu Zhang

validate: remove the top [ and beautify format

it seems not a valid json schema
parent a58b450d
[
{
{
"$id": "https://example.com/person.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"definitions": {
"sane_url": { "format": "uri", "pattern": "^https?://" },
"openhub_url": {"format": "uri", "pattern": "https://www.openhub.net/p/.*/analyses/latest/languages_summary"},
"wikipedia_url": {"format": "uri", "pattern": "https://[a-z]+.wikipedia.org/wiki/.*"},
"sane_url": {
"format": "uri",
"pattern": "^https?://"
},
"openhub_url": {
"format": "uri",
"pattern": "https://www.openhub.net/p/.*/analyses/latest/languages_summary"
},
"wikipedia_url": {
"format": "uri",
"pattern": "https://[a-z]+.wikipedia.org/wiki/.*"
},
"organisation_list": {
"enum": [
"Organisation",
......@@ -82,12 +90,15 @@
"$ref": "#/definitions/organisation_list"
},
"logo_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"location": {
"type": "object",
......@@ -119,16 +130,19 @@
},
"mail_contact": {
"description": "Entity email contact",
"anyOf": [{
"anyOf": [
{
"type": "string",
"pattern": "^\\S+@\\S+\\.\\S+$",
"format": "email",
"minLength": 6,
"maxLength": 127
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"coordinate_list": {
"description": "Geographical coordinates of the entity, [latitude, longitude]",
......@@ -146,12 +160,15 @@
"description": "A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"website_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"founded_year": {
"anyOf": [
......@@ -172,49 +189,64 @@
"type": "integer"
},
"staff": {
"anyOf": [{
"anyOf": [
{
"type": "integer"
}, {
},
{
"type": "string"
}]
}
]
},
"earnings": {
"anyOf": [{
"anyOf": [
{
"type": "string",
"pattern": "\\d*\\s{1}[A-Z]{3}",
"description": "The ISO 4217 currency code."
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"total_assets": {
"anyOf": [{
"anyOf": [
{
"type": "string",
"pattern": "\\d*\\s{1}[A-Z]{3}",
"description": "The ISO 4217 currency code."
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"revenues": {
"anyOf": [{
"anyOf": [
{
"type": "string",
"pattern": "\\d*\\s{1}[A-Z]{3}",
"description": "The ISO 4217 currency code."
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"source_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
}
}
}
......@@ -228,27 +260,36 @@
"type": "string"
},
"logo_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"website_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"created_year": {
"anyOf": [{
"anyOf": [
{
"type": "integer"
}, {
},
{
"type": "string"
}]
}
]
},
"description": {
"type": "string"
......@@ -279,28 +320,37 @@
}
},
"source_code_download": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"source_code_profile": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/openhub_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"commercial_support_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"floss_software": {
"type": "boolean"
......@@ -312,12 +362,15 @@
"type": "boolean"
},
"wikipedia_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/wikipedia_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"reference_list": {
"type": "array",
......@@ -356,12 +409,15 @@
"pattern": "^[a-zA-Z0-9]"
},
"image_url": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/sane_url"
}, {
},
{
"type": "string",
"maxLength": 0
}]
}
]
},
"industry": {
"$ref": "#/definitions/industry_list"
......@@ -390,5 +446,4 @@
}
}
}
}
]
}
......@@ -30,7 +30,7 @@ for fn in filenames:
continue
try:
validate(instance=data, schema=SCHEMA[0])
validate(instance=data, schema=SCHEMA)
except ValidationError as e:
invalid_json_list.append({"file":fn, "error": e.message, "path": e.absolute_path})
continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment