@octokit/webhooks-definitions
Advanced tools
Comparing version 3.65.6 to 3.65.7
{ | ||
"name": "@octokit/webhooks-definitions", | ||
"version": "3.65.6", | ||
"version": "3.65.7", | ||
"description": "machine-readable, always up-to-date GitHub Webhooks specifications", | ||
@@ -27,5 +27,7 @@ "keywords": [], | ||
"pretest": "npm run -s lint", | ||
"test": "npm run build && npm run validate -- --continue-on-error && ts-node -T test.ts", | ||
"test": "npm run build && npm run build:schema && npm run validate -- --continue-on-error && ts-node -T test.ts", | ||
"typecheck": "tsc -p . --noEmit", | ||
"validate": "ts-node -T bin/validate-payload-examples.ts" | ||
"validate": "npm run -s validate:payloads && npm run -s validate:schema", | ||
"validate:payloads": "ts-node -T bin/validate-payload-examples.ts", | ||
"validate:schema": "ts-node -T bin/validate-schema.ts" | ||
}, | ||
@@ -32,0 +34,0 @@ "prettier": {}, |
@@ -259,2 +259,26 @@ # Octokit Webhooks | ||
### Usage with `ajv` in `strict` mode | ||
When running in `strict` mode, `ajv` will throw an "unknown keyword" error if it | ||
encounters any keywords that have not been defined. | ||
This schema currently uses custom keywords provided by `ajv-formats`, along with | ||
the custom keyword `tsAdditionalProperties`. | ||
Here is an example of how you can set this up: | ||
```ts | ||
import type { WebhookEvent } from "@octokit/webhooks-definitions/schema"; | ||
import * as githubWebhookSchema from "@octokit/webhooks-definitions/schema.json"; | ||
import Ajv from "ajv"; | ||
import addFormats from "ajv-formats"; | ||
const ajv = new Ajv({ strict: true }); | ||
addFormats(ajv); | ||
ajv.addKeyword("tsAdditionalProperties"); | ||
const validate = ajv.compile<WebhookEvent>(githubWebhookSchema); | ||
``` | ||
## Importing types | ||
@@ -261,0 +285,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
336
3787179
71338