Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hitchdev/strictyamljsonschema

Translate JSON schemas into StrictYAML schemas.
https://github.com/hitchdev/strictyamljsonschema

Last synced: 15 days ago
JSON representation

Translate JSON schemas into StrictYAML schemas.

Awesome Lists containing this project

README

        

# StrictYAMLJSONSchema

Translate JSON schemas in to StrictYAML schema.

Simple example:

```json
{
"type": "object",
"properties": {
"age": {
"type": "integer"
},
"name": {
"type": "string"
},
"possessions": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["age", "name", "possession"]
}

```

```yaml
# All about the character
name: Ford Prefect
age: 42
possessions:
- Towel

```

```python
from strictyamljsonschema import load_schema
from strictyaml import load
import json

```

Parse correctly:

```python
print(load(yaml_snippet, load_schema(json.loads(json_schema))).data)

```

```yaml
OrderedDict([('name', 'Ford Prefect'), ('age', 42), ('possessions', ['Towel'])])
```

## Install

```sh
$ pip install strictyamljsonschema
```