Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

raml-typesystem

Package Overview
Dependencies
Maintainers
2
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raml-typesystem

This module contains a lightweight implementation of the type system that was introduced with [RAML 1.0](http://raml.org).

  • 0.0.19
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-15.89%
Maintainers
2
Weekly downloads
 
Created
Source

RAML Data Type System

This module contains a lightweight implementation of the type system that was introduced with RAML 1.0.

It allows you to to parse, validate , modify RAML types, as well as store them back to JSON.

Installation

npm install raml-typesystem --save

Usage

Parsing and validating a single type:

import ts = require("raml-typesystem")

var personType = ts.parseJSON("Person", {
  type: "string[]",
  minItems:3,
  maxItems:2
})

var isValid = personType.validateType();

Parsing and validating a types collection:

import ts = require("raml-typesystem")

var typeCollection = ts.parseJSONTypeCollection({
  types: {
    Person: {
      type: "object",
      properties:{
          kind: "string"
      }
    },
    Man: {
      type: "Person",
      discriminator: "kind"
    }
  }
})
var isValid = typeCollection.getType("Person").validateType()

Keywords

FAQs

Package last updated on 06 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc