Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robusgauli/jsonvalidate

WIP
https://github.com/robusgauli/jsonvalidate

dict json json-schema json-schema-validator

Last synced: 5 days ago
JSON representation

WIP

Awesome Lists containing this project

README

        

# JSON Validation Schema







JSON Validation Schema

* Free software: MIT license
* Documentation: https://jsonvalidate.readthedocs.io.

Features
------------

```python
from jsonvalidate import Object, String, Integer

schema = Object({
'email': String(regex='[^@]+@[^@]+\.[^@]+'),
'name': String(),
'age': Integer(enums=[5, 6, 7]),
'address': Object({
'permanent': String(),
'temporary': String(min_length=3, enums=['asss', 's'])
})
})

payload = {
'email': '[email protected]',
'name': 'robus',
'age': 342,
'address': {
'permanent': 'sd',
'temporary': 'asss'
}

}

print(schema.check(payload))
```