- This package, released as
zapier-platform-schema
publicly on npm, dictates the full schema against which apps are validated - It's powered by JSONSchema
- The
core
,schema
, andcli
packages are always released together under matching version numbers.
schema/...
, when used in a path to a file, is shorthand forzapier-platform/packages/schema/...
- Schemas are declared, one-per-file, in
schema/lib/schemas
. - The "root" schema is
schema/lib/schemas/AppSchema.js
, but that one doesn't change much. - There are also functional constraints in
schema/lib/schemas/functional-constraints
, which validate things that JSONSchema can't cover (such as pairs of fields needing to have the same keys). - Docs (in
schema/docs
) are generated directly from schemas viayarn docs
. - Each schema has a
validate
that will validate incoming JSON. This is used incore
to execute thevalidation
command (which is exposed as thezapier validate
command in CLI). Seeschema/lib/utils/makeValidator.js
- tests live in
schema/test
. - Each schema has an array of
examples
andanti-examples
. - Basic tests take each schema and ensure that it passes each of its
examples
and fails each of itsanti-examples
. - There are separate tests for functional constraints.