refract-message-body-generator

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i refract-message-body-generator

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • kylef
  • apiary-sre