Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
european-cloud-industry
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fonds-de-Dotation-du-Libre
european-cloud-industry
Commits
b905b80a
Commit
b905b80a
authored
Oct 03, 2022
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate: remove the top [ and beautify format
it seems not a valid json schema
parent
a58b450d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
396 additions
and
341 deletions
+396
-341
data/JSON-schema.json
data/JSON-schema.json
+395
-340
validator.py
validator.py
+1
-1
No files found.
data/JSON-schema.json
View file @
b905b80a
[
{
{
"$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 @@
}
}
}
}
]
}
validator.py
View file @
b905b80a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment