Skip to content

gratex/sjss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sjss

Simplified JSON Schema syntax, inspired by https://www.npmjs.com/package/strummer but much lighter.

TLDR;

This project allows you to

write this:

{
    "a": "number",
    "b": "string"
}

// or even this (in JS)

{
    "a": Number,
    "b": String
}

instead of this:

{
    "type": "object",
    "properties": {
        "a": {
            "type": "number"
        },
        "b": {
            "type": "string"
        }
    }
}

Or:

{
    "books": [{
        "isbn": "string",
        "author": "string"
    }]
}

instead of this:

{
    "type": "object",
    "properties": {
        "books": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "isbn": {
                        "type": "string"
                    },
                    "author": {
                        "type": "string"
                    }
                }
            }
        }
    }
}	

For more samples see test/fixtures

About

Simplified JSON Schema syntax

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published