{"id":19229695,"url":"https://github.com/oguzhanunlu/validate_json","last_synced_at":"2025-07-11T10:34:47.682Z","repository":{"id":78209651,"uuid":"107564591","full_name":"oguzhanunlu/validate_json","owner":"oguzhanunlu","description":"Restful service to validate JSON docs against JSON schemas","archived":false,"fork":false,"pushed_at":"2017-10-19T21:15:46.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T11:14:34.497Z","etag":null,"topics":["django","json","python","restful-api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oguzhanunlu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-19T15:27:57.000Z","updated_at":"2017-10-19T16:51:47.000Z","dependencies_parsed_at":"2023-03-07T22:00:30.749Z","dependency_job_id":null,"html_url":"https://github.com/oguzhanunlu/validate_json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oguzhanunlu/validate_json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhanunlu%2Fvalidate_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhanunlu%2Fvalidate_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhanunlu%2Fvalidate_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhanunlu%2Fvalidate_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oguzhanunlu","download_url":"https://codeload.github.com/oguzhanunlu/validate_json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhanunlu%2Fvalidate_json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264785930,"owners_count":23663858,"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":["django","json","python","restful-api"],"created_at":"2024-11-09T15:35:26.248Z","updated_at":"2025-07-11T10:34:47.640Z","avatar_url":"https://github.com/oguzhanunlu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# validate_json\n\nRestful service to validate JSON docs against JSON schemas\n\n### Prerequisities\n * Python 2.7\n * pip\n * virtualenv\n * virtualenvwrapper\n\n### Installing \u0026\u0026 Running\n\n* Clone project, `git clone git@github.com:oguzhanunlu/validate_json.git`\n* Create a python2.7 virtual environment\n* Inside environment, run `pip install -r requirements.txt`, to install depencencies.\n* At the root of the project, start Django runserver, `python manage.py runserver`\n\nNow server is up and running at 8000 port.\n\n### API Endpoints\n\n```\nPOST    /schema/SCHEMAID        - Upload JSON Schema with unique `SCHEMAID`\nGET     /schema/SCHEMAID        - Download JSON Schema with unique `SCHEMAID`\n\nPOST    /validate/SCHEMAID      - Validate JSON document against the JSON Schema identified by `SCHEMAID`\n```\n\n### Use case \n\nUser has a JSON file `config.json` as following:\n\n```json\n{\n    \"source\": \"/home/alice/image.iso\",\n    \"destination\": \"/mnt/storage\",\n    \"timeout\": null,\n    \"chunks\": {\n        \"size\": 1024,\n        \"number\": null\n    }\n}\n\n```\n\nAnd expects it conforms to the following JSON Schema `config-schema.json`, after cleaned from keys where value is None:\n\n```json\n{\n    \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"source\": {\n            \"type\": \"string\"\n        },\n        \"destination\": {\n            \"type\": \"string\"\n        },\n        \"timeout\": {\n            \"type\": \"integer\",\n            \"minimum\": 0,\n            \"maximum\": 32767\n        },\n        \"chunks\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"size\": {\n                    \"type\": \"integer\"\n                },\n                \"number\": {\n                    \"type\": \"integer\"\n                }\n            },\n            \"required\": [\"size\"]\n        }\n    },\n    \"required\": [\"source\", \"destination\"]\n}\n\n```\n\nTo check that it really fits the schema:\n\n1. Upload the JSON Schema: `curl http://localhost:8000/schema/config-schema -X POST -d @config-schema.json`\n2. Response will be: `{\"action\": \"uploadSchema\", \"id\": \"config-schema\", \"status\": \"success\"}` and status code 201\n3. Upload the JSON document to validate it `curl http://localhost:8000/validate/config-schema -X POST -d @config.json`\n4. Response will be: `{\"action\": \"validateDocument\", \"id\": \"config-schema\", \"status\": \"success\"}` and status code 200\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhanunlu%2Fvalidate_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foguzhanunlu%2Fvalidate_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhanunlu%2Fvalidate_json/lists"}