- This package, released as
zapier-platform-schemapublicly on npm, dictates the full schema against which apps are validated - It's powered by JSONSchema
- The
core,schema, andclipackages 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 viapnpm build-docs. - Each schema has a
validatethat will validate incoming JSON. This is used incoreto execute thevalidationcommand (which is exposed as thezapier validatecommand in CLI). Seeschema/lib/utils/makeValidator.js
- tests live in
schema/test. - Each schema has an array of
examplesandanti-examples. - Basic tests take each schema and ensure that it passes each of its
examplesand fails each of itsanti-examples. - There are separate tests for functional constraints.