raml-typesystem

WebJar for raml-typesystem

License

License

GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

raml-typesystem
Last Version

Last Version

0.0.86
Release Date

Release Date

Type

Type

jar
Description

Description

raml-typesystem
WebJar for raml-typesystem
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/raml-org/raml-typesystem

Download raml-typesystem

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/raml-typesystem/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>raml-typesystem</artifactId>
    <version>0.0.86</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/raml-typesystem/
implementation 'org.webjars.npm:raml-typesystem:0.0.86'
// https://jarcasting.com/artifacts/org.webjars.npm/raml-typesystem/
implementation ("org.webjars.npm:raml-typesystem:0.0.86")
'org.webjars.npm:raml-typesystem:jar:0.0.86'
<dependency org="org.webjars.npm" name="raml-typesystem" rev="0.0.86">
  <artifact name="raml-typesystem" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='raml-typesystem', version='0.0.86')
)
libraryDependencies += "org.webjars.npm" % "raml-typesystem" % "0.0.86"
[org.webjars.npm/raml-typesystem "0.0.86"]

Dependencies

compile (11)

Group / Artifact Type Version
org.webjars.npm » json-schema-compatibility jar [1.1.0]
org.webjars.npm : xml2js jar [0.4.19]
org.webjars.npm : bignumber.js jar [4.1.0]
org.webjars.npm : escape-html jar [1.0.3]
org.webjars.npm : lrucache jar [1.0.3]
org.webjars.npm : json-to-ast jar [2.0.0-alpha1.3]
org.webjars.npm : xmldom jar [0.1.27]
org.webjars.npm : underscore jar [1.8.3]
org.webjars.npm : date-and-time jar [0.5.0]
org.webjars.npm » raml-xml-validation Optional jar [0.0.14]
org.webjars.npm » raml-json-validation Optional jar [0.0.16]

Project Modules

There are no modules declared in this project.

RAML Data Type System

Build Status Greenkeeper badge

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.loadType( {
    type: "string[]",
    minItems:3,
    maxItems:2
})

var isValid = personType.validateType();

Parsing and validating a types collection:

import ts = require("raml-typesystem")

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

Validating object against type:

import ts = require("raml-typesystem")

var typeCollection = ts.loadTypeCollection({
    types: {
        Person: {
            type: "object",
            properties:{
                kind: "string"
            }
        },
        Man: {
            type: "Person",
            discriminator: "kind"
        }
    }
})
var isValid = typeCollection.getType("Person").validate({dd: true})

Contribute

The raml-typesystem repo is an open source project and any contribution is always welcome. Please follow these simple steps when contributing to this project:

  1. Check for open issues or open a fresh issue to start a discussion around an idea or a bug.
  2. Fork the repository on Github and make your changes on the develop branch (or branch off of it).
  3. Send a pull request (with the develop branch as the target).
  4. One of the main contributor or admin will review the PR and merge.

A big thank you goes out to everyone who helped with the project, the contributors and everyone who took the time to report issues and give feedback.

You can also directly get in touch with us. Simply send us an email to: [email protected]

org.webjars.npm

RAML

The simplest way to model APIs

Versions

Version
0.0.86