Lib to convert JSON-Schema to zapier schema
npm install zapier-platform-json-schema
This project converts json Schema to the ZapierPlatform schema with zero runtime dependencies.
* npm install zapier-platform-json-schema --save
* yarn add zapier-platform-json-schema
``javascript
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' } ]
`
| Feature | Status | Comment|
| ------------- |:-------------:| -----:|
| strings | ✅ | Example |
| boolean | ✅ | Example |
| datetime | ✅ | Example |
| enum | ✅ | Example |
| array of enum | ✅ | Example |
| array | ✅ | |
| anyOf | ✅ | |
| anyOf prefer non-string | ✅ | Example |
| $ref to external| ❌ | |
| $ref to object| ✅ | Example |
| $ref to enum | ✅ | Example |
| get nested defeintion | ✅ | Example |
| Additional props | ✅ | Example |
| required | ✅ | Example |
| label | ✅ | Example |
Release
Just add a new tag via github or git tag` please use Semantic Versioning 2.0.0