Socket
Book a DemoInstallSign in
Socket

refract-message-body-generator

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refract-message-body-generator

Generates message bodies from JSON Schema in Refract tree

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
6
Created
Source

Refract Message Body Generator CircleCI Build Status

Generates message bodies from JSON Schema found within Refract API Description.

For example, it takes a message body schema asset and generates a message body asset.

It takes a Refract element such as the following:

{
  "element": "asset",
  "meta": {
    "classes": ["messageBodySchema"]
  },
  "attributes": {
    "contentType": "application/schema+json"
  },
  "content": "{\"type\": \"string\"}"
}

and it will place the following message body asset as a sibling of the that element

{
  "element": "asset",
  "meta": {
    "classes": ["messageBody"]
  },
  "attributes": {
    "contentType": "application/json"
  },
  "content": "\"ut omnis\""
}

Usage

import generateMessageBodies from 'refract-message-body-generator';
generateMessageBodies([Refract Element]);

Installation

$ npm install refract-message-body-generator

FAQs

Package last updated on 09 May 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