Tiny tool for Django JSONField validation
Project description
django-json-field-schema-validator
Tiny tool for Django JSONField validation through JSON Schema
Installation
pip install django-json-field-schema-validator
Example
from django.db import models
from django_json_field_schema_validator.validators import JSONFieldSchemaValidator
schema = {
'$schema': f'http://json-schema.org/draft-07/schema#',
'type': 'object',
'properties': {
'foo': {'type': 'number'},
'bar': {'type': 'string'}
},
'required': ['foo', 'bar']
}
class SomeModel(models.Model):
some_field = models.JSONField(validators=[JSONFieldSchemaValidator(schema)])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-json-field-schema-validator-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cb0323ad13ae5aa2e1d1ab3f4c02a8ea06aba7f9785f29cb568a4499d00c070 |
|
MD5 | 5d61437b3be3ecb1476535b19f29f93e |
|
BLAKE2b-256 | f27806bcab59e2af983ead5c08ec6de878cbc1f9a023d81cd7e08cc0f6de33a4 |
Close
Hashes for django_json_field_schema_validator-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92e87812c2fa1fc696ae2b74e2d90c66cfc5989fd38b05b479d7fa5d5dd01e67 |
|
MD5 | 04ed7d667dda9c9a02a87ef483378a72 |
|
BLAKE2b-256 | 9f588c0871e61637b7d9db19e5a3da8dfa1fa50c443c7f94ad746f03c950d839 |