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
Hide 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/.*"
},
"organisation_list"
:
{
"enum"
:
[
"Organisation"
,
"Association"
,
"Other"
]
},
"industry_list"
:
{
"enum"
:
[
"Academia and Research"
,
"Agriculture and Food"
,
"Associations and NGOs"
,
"Aviation and Aerospace"
,
"Automotive"
,
"Banking and Finance"
,
"Chemicals"
,
"Commerce and Retail"
,
"Construction"
,
"Consulting and Training"
,
"Defense"
,
"Education"
,
"Energy and Utilities"
,
"Health and Life Sciences"
,
"Housing and Real Estate"
,
"Insurance"
,
"Information Technology"
,
"Manufacturing"
,
"Media and Entertainment"
,
"Public Administration and Government"
,
"Telecommunication"
,
"Transport"
,
"Travel and Tourism"
]
},
"category_list"
:
{
"enum"
:
[
"Storage and database"
,
"Compute virtualisation"
,
"Desktop virtualisation"
,
"vRan"
,
"Operation management"
,
"Service lifecycle automation"
,
"Networking"
,
"Identity"
,
"Cybersecurity"
,
"Application"
,
"Workspace"
,
"Developer environment"
,
"Developer API"
,
"Communication"
,
"IoT and industrial"
,
"Big Data Hub"
,
"Server"
,
"Switch"
,
"Router"
,
"Rack"
,
"Cooling"
,
"CPU"
,
"Radio"
]
}
{
"$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?://"
},
"properties"
:
{
"created"
:
{
"type"
:
"string"
,
"format"
:
"date"
,
"pattern"
:
"^
\\
d{4}
\\
-(0?[1-9]|1[012])
\\
-(0?[1-9]|[12][0-9]|3[01])$"
},
"title"
:
{
"type"
:
"string"
},
"type"
:
{
"$ref"
:
"#/definitions/organisation_list"
},
"logo_url"
:
{
"anyOf"
:
[{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"location"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"description"
:
"Entity name"
},
"address"
:
{
"type"
:
"string"
,
"description"
:
"Entity address"
},
"postal-code"
:
{
"description"
:
"Entity postal code"
,
"type"
:
"string"
},
"city"
:
{
"type"
:
"string"
,
"description"
:
"Entity city"
},
"country"
:
{
"type"
:
"string"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"Entity country - a valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"phone_contact"
:
{
"description"
:
"Entity phone contact"
,
"type"
:
"string"
},
"mail_contact"
:
{
"description"
:
"Entity email contact"
,
"anyOf"
:
[{
"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"
,
"Association"
,
"Other"
]
},
"industry_list"
:
{
"enum"
:
[
"Academia and Research"
,
"Agriculture and Food"
,
"Associations and NGOs"
,
"Aviation and Aerospace"
,
"Automotive"
,
"Banking and Finance"
,
"Chemicals"
,
"Commerce and Retail"
,
"Construction"
,
"Consulting and Training"
,
"Defense"
,
"Education"
,
"Energy and Utilities"
,
"Health and Life Sciences"
,
"Housing and Real Estate"
,
"Insurance"
,
"Information Technology"
,
"Manufacturing"
,
"Media and Entertainment"
,
"Public Administration and Government"
,
"Telecommunication"
,
"Transport"
,
"Travel and Tourism"
]
},
"category_list"
:
{
"enum"
:
[
"Storage and database"
,
"Compute virtualisation"
,
"Desktop virtualisation"
,
"vRan"
,
"Operation management"
,
"Service lifecycle automation"
,
"Networking"
,
"Identity"
,
"Cybersecurity"
,
"Application"
,
"Workspace"
,
"Developer environment"
,
"Developer API"
,
"Communication"
,
"IoT and industrial"
,
"Big Data Hub"
,
"Server"
,
"Switch"
,
"Router"
,
"Rack"
,
"Cooling"
,
"CPU"
,
"Radio"
]
}
},
"properties"
:
{
"created"
:
{
"type"
:
"string"
,
"format"
:
"date"
,
"pattern"
:
"^
\\
d{4}
\\
-(0?[1-9]|1[012])
\\
-(0?[1-9]|[12][0-9]|3[01])$"
},
"title"
:
{
"type"
:
"string"
},
"type"
:
{
"$ref"
:
"#/definitions/organisation_list"
},
"logo_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"location"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"description"
:
"Entity name"
},
"address"
:
{
"type"
:
"string"
,
"description"
:
"Entity address"
},
"postal-code"
:
{
"description"
:
"Entity postal code"
,
"type"
:
"string"
},
"city"
:
{
"type"
:
"string"
,
"description"
:
"Entity city"
},
"country"
:
{
"type"
:
"string"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"Entity country - a valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"phone_contact"
:
{
"description"
:
"Entity phone contact"
,
"type"
:
"string"
},
"mail_contact"
:
{
"description"
:
"Entity email contact"
,
"anyOf"
:
[
{
"type"
:
"string"
,
"pattern"
:
"^
\\
S+@
\\
S+
\\
.
\\
S+$"
,
"format"
:
"email"
,
"minLength"
:
6
,
"maxLength"
:
127
},
{
"type"
:
"string"
,
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"coordinate_list"
:
{
"description"
:
"Geographical coordinates of the entity, [latitude, longitude]"
,
"type"
:
"array"
,
"maxItems"
:
2
,
"items"
:
{
"type"
:
"number"
}
]
},
"coordinate_list"
:
{
"description"
:
"Geographical coordinates of the entity, [latitude, longitude]"
,
"type"
:
"array"
,
"maxItems"
:
2
,
"items"
:
{
"type"
:
"number"
}
}
},
"subsidiary_location_list"
:
{
"type"
:
"array"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"website_url"
:
{
"anyOf"
:
[{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"founded_year"
:
{
"anyOf"
:
[
{
}
},
"subsidiary_location_list"
:
{
"type"
:
"array"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"website_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"founded_year"
:
{
"anyOf"
:
[
{
"type"
:
"integer"
},
{
"type"
:
"string"
}
]
},
"kpi_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"year"
:
{
"type"
:
"integer"
},
{
"type"
:
"string"
}
]
},
"kpi_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"year"
:
{
"type"
:
"integer"
},
"staff"
:
{
"anyOf"
:
[{
"staff"
:
{
"anyOf"
:
[
{
"type"
:
"integer"
},
{
},
{
"type"
:
"string"
}]
},
"earnings"
:
{
"anyOf"
:
[{
}
]
},
"earnings"
:
{
"anyOf"
:
[
{
"type"
:
"string"
,
"pattern"
:
"
\\
d*
\\
s{1}[A-Z]{3}"
,
"description"
:
"The ISO 4217 currency code."
},
{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"total_assets"
:
{
"anyOf"
:
[{
}
]
},
"total_assets"
:
{
"anyOf"
:
[
{
"type"
:
"string"
,
"pattern"
:
"
\\
d*
\\
s{1}[A-Z]{3}"
,
"description"
:
"The ISO 4217 currency code."
},
{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"revenues"
:
{
"anyOf"
:
[{
}
]
},
"revenues"
:
{
"anyOf"
:
[
{
"type"
:
"string"
,
"pattern"
:
"
\\
d*
\\
s{1}[A-Z]{3}"
,
"description"
:
"The ISO 4217 currency code."
},
{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"source_url"
:
{
"anyOf"
:
[{
}
]
},
"source_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
}
}
]
}
}
},
"solution_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
},
"logo_url"
:
{
"anyOf"
:
[{
}
},
"solution_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
},
"logo_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"website_url"
:
{
"anyOf"
:
[{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"created_year"
:
{
"anyOf"
:
[{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"website_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"created_year"
:
{
"anyOf"
:
[
{
"type"
:
"integer"
},
{
},
{
"type"
:
"string"
}]
},
"description"
:
{
"type"
:
"string"
},
"category_list"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"#/definitions/category_list"
}
},
"similar_solution_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"similar_solution_url"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"category"
:
{
"$ref"
:
"#/definitions/category_list"
}
]
},
"description"
:
{
"type"
:
"string"
},
"category_list"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"#/definitions/category_list"
}
},
"similar_solution_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"similar_solution_url"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"category"
:
{
"$ref"
:
"#/definitions/category_list"
}
}
},
"source_code_download"
:
{
"anyOf"
:
[{
}
},
"source_code_download"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"source_code_profile"
:
{
"anyOf"
:
[{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"source_code_profile"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/openhub_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"commercial_support_url"
:
{
"anyOf"
:
[{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"commercial_support_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"floss_software"
:
{
"type"
:
"boolean"
},
"commercial_support_open_source_version"
:
{
"type"
:
"boolean"
},
"commercial_support_available"
:
{
"type"
:
"boolean"
},
"wikipedia_url"
:
{
"anyOf"
:
[{
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"floss_software"
:
{
"type"
:
"boolean"
},
"commercial_support_open_source_version"
:
{
"type"
:
"boolean"
},
"commercial_support_available"
:
{
"type"
:
"boolean"
},
"wikipedia_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/wikipedia_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"reference_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"logo_url"
:
{
"$ref"
:
"#/definitions/sane_url"
},
"country"
:
{
"type"
:
"string"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"industry"
:
{
"$ref"
:
"#/definitions/industry_list"
}
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"reference_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"logo_url"
:
{
"$ref"
:
"#/definitions/sane_url"
},
"country"
:
{
"type"
:
"string"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"industry"
:
{
"$ref"
:
"#/definitions/industry_list"
}
}
},
"success_case_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"description"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"image_url"
:
{
"anyOf"
:
[{
}
},
"success_case_list"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"title"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"description"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"image_url"
:
{
"anyOf"
:
[
{
"$ref"
:
"#/definitions/sane_url"
},
{
"type"
:
"string"
,
"maxLength"
:
0
}]
},
"industry"
:
{
"$ref"
:
"#/definitions/industry_list"
},
"customer"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"country"
:
{
"type"
:
"string"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"language"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-z]{2}$"
,
"description"
:
"A valid 2-digit ISO language code"
},
"success_case_url"
:
{
"$ref"
:
"#/definitions/sane_url"
}
},
{
"type"
:
"string"
,
"maxLength"
:
0
}
]
},
"industry"
:
{
"$ref"
:
"#/definitions/industry_list"
},
"customer"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-zA-Z0-9]"
},
"country"
:
{
"type"
:
"string"
,
"pattern"
:
"^[A-Z]{2}$"
,
"description"
:
"A valid 2-digit ISO country code (ISO 3166-1 alpha-2)"
},
"language"
:
{
"type"
:
"string"
,
"pattern"
:
"^[a-z]{2}$"
,
"description"
:
"A valid 2-digit ISO language code"
},
"success_case_url"
:
{
"$ref"
:
"#/definitions/sane_url"
}
}
}
...
...
@@ -391,4 +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