Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wblxyxolbkhv/django-json-field-schema-validator
Tiny tool for Django JSONField validation through JSON Schema
https://github.com/wblxyxolbkhv/django-json-field-schema-validator
django json-schema jsonfield python validator
Last synced: 3 months ago
JSON representation
Tiny tool for Django JSONField validation through JSON Schema
- Host: GitHub
- URL: https://github.com/wblxyxolbkhv/django-json-field-schema-validator
- Owner: wblxyxolbkhv
- License: mit
- Created: 2021-02-03T19:34:59.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-15T11:19:14.000Z (over 1 year ago)
- Last Synced: 2024-09-26T21:24:06.688Z (3 months ago)
- Topics: django, json-schema, jsonfield, python, validator
- Language: Python
- Homepage: https://pypi.org/project/django-json-field-schema-validator/
- Size: 13.7 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# django-json-field-schema-validator
[![Build Status](https://app.travis-ci.com/wblxyxolbkhv/django-json-field-schema-validator.svg?branch=main)](https://travis-ci.org/wblxyxolbkhv/django-json-field-schema-validator.svg?branch=main)
[![Coverage Status](https://coveralls.io/repos/github/wblxyxolbkhv/django-json-field-schema-validator/badge.svg?branch=main)](https://coveralls.io/github/wblxyxolbkhv/django-json-field-schema-validator?branch=main)
[![Downloads](https://static.pepy.tech/badge/django-json-field-schema-validator/month)](https://pepy.tech/project/django-json-field-schema-validator)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)Tiny tool for Django JSONField validation through [JSON Schema](https://python-jsonschema.readthedocs.io/en/latest/validate/)
## Installation```shell script
pip install django-json-field-schema-validator
```## Example
```python
from django.db import models
from django_json_field_schema_validator.validators import JSONFieldSchemaValidatorschema = {
'$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)])```