{"id":20901431,"url":"https://github.com/38elements/simplejsonvalidator","last_synced_at":"2025-07-08T00:33:35.385Z","repository":{"id":9522781,"uuid":"11421718","full_name":"38elements/SimpleJsonValidator","owner":"38elements","description":null,"archived":false,"fork":false,"pushed_at":"2013-07-20T00:25:32.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T09:54:36.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/38elements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-15T11:34:44.000Z","updated_at":"2013-12-06T09:34:04.000Z","dependencies_parsed_at":"2022-08-31T01:14:48.960Z","dependency_job_id":null,"html_url":"https://github.com/38elements/SimpleJsonValidator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/38elements/SimpleJsonValidator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38elements%2FSimpleJsonValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38elements%2FSimpleJsonValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38elements%2FSimpleJsonValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38elements%2FSimpleJsonValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/38elements","download_url":"https://codeload.github.com/38elements/SimpleJsonValidator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38elements%2FSimpleJsonValidator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264169163,"owners_count":23567263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T11:30:45.199Z","updated_at":"2025-07-08T00:33:35.353Z","avatar_url":"https://github.com/38elements.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"SimpleJsonValidator\n===================\n[![Build Status](https://travis-ci.org/38elements/SimpleJsonValidator.png)](https://travis-ci.org/38elements/SimpleJsonValidator)  \nJson形式のデータに対してスキーマを定義して型チェックを行なうプログラム。  \nRedisやmemcacheでJsonを文字列で保存する際のチェックに用いる。\n  \n* スキーマの型はint, float, bool, str, list, dictのみを指定する。\n* スキーマのintはint及びlongを許容する。\n* スキーマのstrはstr及びunicodeを許容する。\n* スキーマのlistは要素を1つのみ持つことができる。  \n (listの要素の型は1種類である。)\n* スキーマと検証対象のデータのdictのキーは数や名称が一致していないと不正になる。\n* 検証対象のデータにNone(null)があった場合は不正になる。\n\n```python\n# coding: utf-8\nfrom simple_json_validator import SimpleJsonValidator\n\nschema = {\n    \"name\": str,\n    \"year\": int,\n    \"ids\": [int],\n    \"items\": [\n        {\n            \"id\": int,\n            \"name\": str\n        }\n    ]\n}\n\ndata = {\n    \"name\": \"name1\",\n    \"year\": 2000,\n    \"ids\": [20,3,61,21],\n    \"items\": [\n        {\n            \"id\": 43,\n            \"name\": \"name2\",\n        },\n        {\n            \"id\": 44,\n            \"name\": \"name3\",\n        },\n    ]\n}\n\nsjv = SimpleJsonValidator(schema)\nsjv.validate(data)\n//=\u003eTrue\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F38elements%2Fsimplejsonvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F38elements%2Fsimplejsonvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F38elements%2Fsimplejsonvalidator/lists"}