Skip to content

Mobility as a Service API - data model, tests, and validation

License

Notifications You must be signed in to change notification settings

alapto/maas-schemas

 
 

Repository files navigation

MaaS-schemas submodule

Build Status

This repository contains the JSON schemas used by MaaS.

Features

  • Newest JSON schemas spec + AJV
  • Out of the box validator

JavaScript API

/**
 *  Validate an object by first resolving the corresponding schema by schemaId
 *  NOTE: It is recommended to use schema $id instead of raw schema object
 *
 *  @param {Object/String} schema/schema.$id - schema from the schemas folder. If given as a whole, will extract $id from the schema. None existed schema will be re-validate. If given only $id, will use that to reference to schema
 *  @param {Object} object - input testing subject
 *  @return {Object} resolve w/validated object
 *  @throws {ValidationError}
 */
function validate(schema, object, options)

About

Mobility as a Service API - data model, tests, and validation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%