diff --git a/Makefile b/Makefile index 1cc718a..c0cf532 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,6 @@ build-launcher: check-arch package-linux: python3 scripts/package.py linux \ --includes \ - settings/omegacfg.jvv \ settings/properties.json \ bundle/fontconfigs \ --version $(version) \ diff --git a/jsonvv/README.md b/jsonvv/README.md deleted file mode 100644 index b11a14c..0000000 --- a/jsonvv/README.md +++ /dev/null @@ -1,728 +0,0 @@ -# JSONvv - -JSON value validator - -## Overview - -This is a simple JSON schema validator library. It was created for Camoufox to validate passed user configurations. Because I found it useful for other projects, I decided to extract it into a separate library. - -JSONvv's syntax parser is written in pure Python. It does not rely on any dependencies. - -### Example - -
| Configuration | -Validator | -
|---|---|
| - -```python -config = { - "username": "johndoe", - "email": "johndoe@example.com", - "age": 30, - "chat": "Hello world!", - "preferences": { - "notifications": True, - "theme": "dark" - }, - "allowed_commands": [ - "/help", "/time", "/weather" - ], - "location": [40.7128, -74.0060], - "hobbies": [ - { - "name": "Traveling", - "cities": ["Paris", "London"] - }, - { - "name": "reading", - "hours": { - "Sunday": 2, - "Monday": 3, - } - } - ] -} -``` - - | -- -```python -validator = { - "username": "str", # Basic username - "email": "str[/\S+@\S+\.\S+/]", # Validate emails - "age": "int[>=18]", # Age must be 18 or older - "chat": "str | nil", # Optional chat message - "preferences": { - "notifications": "bool", - "theme": "str[light, dark] | nil", # Optional theme - }, - # Commands must start with "/", but not contain "sudo" - "allowed_commands": "array[str[/^//] - str[/sudo/]]", - # Validate coordinate ranges - "location": "tuple[double[-90 - 90], double[-180 - 180]]", - # Handle an array of hobby types - "hobbies": "array[@traveling | @other, >=1]", - "@traveling": { - # Require 1 or more cities/countries iff name is "Traveling" - "*name,type": "str[Traveling]", - "*cities,countries": "array[str[A-Za-z*], >=1]", - }, - "@other": { - "name,type": "str - str[Traveling]", # Non-traveling types - # If hour(s) is specified, require days have >0 hours - "/hours?/": { - "*/day$/": "int[>0]" - } - } -} -``` - - | -