Skip to main content

django-json-field-schema-validator

Build Status Coverage Status Code style: black

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)])

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-json-field-schema-validator-0.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django-json-field-schema-validator-0.0.2.tar.gz.

File metadata

  • Download URL: django-json-field-schema-validator-0.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.4

File hashes

Hashes for django-json-field-schema-validator-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3cb0323ad13ae5aa2e1d1ab3f4c02a8ea06aba7f9785f29cb568a4499d00c070
MD5 5d61437b3be3ecb1476535b19f29f93e
BLAKE2b-256 f27806bcab59e2af983ead5c08ec6de878cbc1f9a023d81cd7e08cc0f6de33a4

See more details on using hashes here.

File details

Details for the file django_json_field_schema_validator-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: django_json_field_schema_validator-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.4

File hashes

Hashes for django_json_field_schema_validator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 92e87812c2fa1fc696ae2b74e2d90c66cfc5989fd38b05b479d7fa5d5dd01e67
MD5 04ed7d667dda9c9a02a87ef483378a72
BLAKE2b-256 9f588c0871e61637b7d9db19e5a3da8dfa1fa50c443c7f94ad746f03c950d839

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page