0.4.13 • Published 2 years ago

@supermercadoscaetano/zapier-platform-json-schema v0.4.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Build Status

Zapier Platform JSON Schema

This project converts json Schema to the ZapierPlatform schema with zero runtime dependencies.

Getting started

  • npm install zapier-platform-json-schema --save

  • yarn add zapier-platform-json-schema

const {default: ZapierSchemaBuilder} = require ("zapier-platform-json-schema");

const schema = {
    "type": "object",
    "properties": {
        "stringProp": {
            "type": "string"
        },
        "excludedProp": {
            "type": "string"
        },
    },
};

console.log(new ZapierSchemaBuilder(schema)
  .addExclude("excludedProp")
  .build());

// prints: [ { key: 'stringProp', type: 'string' } ]

Features

The following list summarize the current scope and supported features of this lib.

FeatureStatusComment
stringsExample
booleanExample
datetimeExample
enumExample
array of enumExample
array
anyOf
anyOf prefer non-stringExample
$ref to external
$ref to objectExample
$ref to enumExample
get nested defeintionExample
Additional propsExample
requiredExample
labelExample

Test

To run the test just use the yarn script: yarn test

Release

Just add a new tag via github or git tag please use Semantic Versioning 2.0.0

0.4.13

2 years ago

0.4.12

2 years ago