【发布时间】:2021-09-05 21:30:42
【问题描述】:
你好,我的json结构如下:
{
"datasetType": "monolingual-corpus",
"languages": {
"sourceLanguage": "hi"
},
"collectionSource": [
"http://pib.gov.in/"
],
"domain":[
"news"
],
"license": "cc-by-4.0",
"submitter": {
"name": "Project aroad",
"aboutMe": "Open source project run by aroad foundation",
"team": [
{
"name": "Navneet Kumar hegde",
"aboutMe": "NLP team lead at Project aroad"
},
{
"name": "Aswini Pradeep",
"aboutMe": "Backend team lead at Project aroad"
}
]
}
我只能使用 json 模式来验证 datasetType。我如何验证其他值,例如“languages”、“collectoinsource”、“submitter”。 在“提交者”中,所有字段都应为必填项,以及如何在“提交者”中验证“团队”
我用 python 编写的代码仅验证“datasetType”,无法验证剩余字段。 请帮助我,提前谢谢
【问题讨论】:
标签: python json python-3.x jsonschema