Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

schema-ast

A bunch of helpers for JSON schema

Example

var V = require("schema-ast");

var requestSchema = V.http.Request({
    method: 'POST',
    body: {
        email: V.email(),
        confirmEmail: V.email(),
        password: V.string({
            'minLength': 8,
            'maxLength': Infinity
        })
    }
});

var responseSchema = V.union([
    V.http.Response({
        statusCode: 200,
        body: schemas.UserModel
    }),
    V.http.TypedError({
        statusCode: 400,
        type: 'services.user.duplicate-email'
    }, {
        email: V.string()
    }),
    V.http.TypedError(LoggedInError),
    V.http.TypedError(EmailNotSameError)
]);

Docs

// TODO. State what the module does.

Installation

npm install schema-ast

Tests

npm test

Contributors

  • Raynos

MIT Licenced

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages