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 SomeMode(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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d69fe7dc795516fd5e75e7ccd2b71bb1fbbffb395e38368ef1cd6e8aa3c879f |
|
MD5 | e20d5e5afb7661399367c1dfdbc0c978 |
|
BLAKE2b-256 | e6d874786b1049da52f10a41dc43306cd2c7de3e303bb6275b2f63424934a29d |
Close
Hashes for django_json_field_schema_validator-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c57335e402647719c3e43c9680fba718dcb7fe6c70f5d069670e139f6c38acd3 |
|
MD5 | 1e8c1697fe4b4b82df40a2cf5be8ebbf |
|
BLAKE2b-256 | 9f4c512df1ccd67485686f7a09516534f6f235cefce523328a2a57d87031cfbb |