A set of utilities to generate JSON Schema from simple JSON objects
Project description
schemautil
A set of utilities to generate JSON Schema from simple JSON objects.
Example
Given the following object schema:
{
"type": "object",
"properties": {
"a": { "type": "string" },
"b": { "type": "string" }
},
"required": ["a", "b"],
"additionalProperties": false
}
You can generate this schema using:
obj_schema({"a": "string", "b": "string"})
Rules
- All fields are required and
additionalPropertiesis always set tofalse. - To make a field nullable, add a
?to the end of its name.
Example:{"a": "string", "b?": "string"}(bis nullable) - To define an array, wrap the type in brackets.
Example:{"a": "string", "b": ["string"]}(bis an array of strings)
Note: There should be only one type in the array. - To define a field that can be one of multiple types, list the types in brackets.
Example:{"a": "string", "b": ["string", "number"]}(bcan be a string or a number)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bfg_schemautil-0.1.0.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bfg_schemautil-0.1.0.tar.gz.
File metadata
- Download URL: bfg_schemautil-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d012c6924ee4d1a36b5d108738032f10d5057e19683cf4700a2a4b5478d4657
|
|
| MD5 |
9050eec7f915cd8b8f82305f5fd2476c
|
|
| BLAKE2b-256 |
a3eb8b9045c5025193e9deb2ae48788caa2d8cc3c2edc48c5fec71b9907bd585
|
File details
Details for the file bfg_schemautil-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bfg_schemautil-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3a085478e1a853071363c3c843906caaf6521bc65bc1855f359e79ee49798ec
|
|
| MD5 |
a75af6987d8cb0b10fcdf89028ed5eb2
|
|
| BLAKE2b-256 |
1b8d9c50bbfda3c554cad9d054c8377dd48d057a1b04bb90e43a3ecbde869c91
|