🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

django-json-field-schema-validator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-json-field-schema-validator

Tiny tool for Django JSONField validation

0.0.2
Source
PyPI
Maintainers
1

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

Keywords

django json field schema validator tools

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts