Comments (3)
Here's a rough idea of how to make schemas
Creating a new schema
Schemas are manually created using example payloads for webhook events.
- Create a new folder for the event in
payload-schemas/api.github.com
, if it doesn't already exist - Create a new empty JSON file named
<action>.schema.json
if the event has anaction
property, otherwise name itevent.schema.json
- Set the
$schema
property to"http://json-schema.org/draft-07/schema"
- The
$id
property's value should be in the format<eventName>$action
, where<eventName>
is the name of the event, andaction
is the value of theaction
property of the webhook payload or simplyevent
if there is noaction
property for the event - the
title
property's value should be in the format<eventName> <action> event
, where<eventName>
is the name of the event, and<action>
is the value of theaction
property of the webhook payload. If there is no action, the it should simply be<eventName> event
type
should beobject
- Add any required properties in an array in the
required
property - Define properties of the payload in the
properties
property as an object in that property, like so:
{
"properties": {
"myproperty": {
"type": "int",
"description": "My Property's description"
}
}
}
- When a property is a
string
, ornumber
and has a defined set of values it can be, add the values in an array in theenum
property of the property's object - When a property can be of multiple types, use a
oneOf
for the decleration of that property, and declare each type in theoneOf
- When a property can be not present:
- if there is only one other type the property can be, change the
type
property to an array including the type, and the stringnull
- if there are more than one other type, that the property can be, simply add it to the
oneOf
- if there is only one other type the property can be, change the
- Repeat until you reach the lowest level of the payload
- Add
"additionalProperties": false
to each property of the payload, and to the root of the document as well
from webhooks.
This is great! Would you like to send a pull request for the contributing file?
from webhooks.
🎉 This issue has been resolved in version 6.0.0 🎉
The release is available on:
- GitHub release
- npm package (@latest dist-tag)
- npm package (@latest dist-tag)
- npm package (@latest dist-tag)
Your semantic-release bot 📦🚀
from webhooks.
Related Issues (20)
- Include event source/type as a property HOT 3
- Changes object can be undefined HOT 2
- Changes object has 19 possible keys but type is defined with only 3 of them HOT 5
- InstallationSuspendEvent installation property is typed to 'never' HOT 3
- Document that `strictNullChecks` is required to be enabled HOT 2
- Missing events HOT 4
- [BUG]: Remove required 'test' Check Run from repository HOT 2
- [BUG]: ProjectsV2Item and archived_at for created/converted events HOT 2
- [BUG]: invalid organization format in schema for repository HOT 7
- [BUG]: InstallationUnsuspendEvent.installation is never HOT 9
- [BUG]: Incorrect secret_scanning_alert values (OpenAPI schema) HOT 2
- [BUG]: Webhook created type HOT 3
- [BUG]: `registry_package` is missing `installation` object HOT 2
- [BUG]: Type changed for `installation_repositories` event HOT 5
- [BUG]: `pull_request.auto_merge` properties should allow string or null HOT 6
- Add missing `merge_queue_entry` event HOT 1
- [MAINT]: Release is failing HOT 4
- [BUG]: Property 'title' does not exist on type 'never'. The intersection 'Issue & { state: "open"; closed_at: null; }' was reduced to 'never' because property 'closed_at' has conflicting types in some constituents. HOT 2
- [BUG]: completed workflow steps should have "cancelled" as possible conclusion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webhooks.