compare-gh-webhook-to-schema-function's People
compare-gh-webhook-to-schema-function's Issues
Use personal access token for update workflow so that checks trigger
Currently checks don't trigger as we're using GITHUB_TOKEN
, which isn't allowed to trigger workflows to protect against inf. loops.
Schemas are duplicated in the generated types
Whenever a schema has
"type": [
"object",
"null"
],
it duplicates the schema, by using the intersection type and wrapping it in parenthesis and appending | null
, insteaf of just appending | null
Example: (common/installation)
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "common/installation.schema.json",
"type": [
"object",
"null"
],
"required": [
"id",
"node_id"
],
"properties": {
"id": {
"type": "integer"
},
"node_id": {
"type": "string"
}
},
"additionalProperties": false,
"title": "Installation"
}
Will turn into
export type Installation = {
id: number;
node_id: string;
} & ({
id: number;
node_id: string;
} | null);
Don't push the same error, for the same property multiple times
{
"summary": "oh dear, there were errors :/",
"errors": [
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"assigned"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"closed"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"edited"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"labeled"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"locked"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"opened"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"ready_for_review"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "additionalProperties",
"dataPath": "/pull_request",
"schemaPath": "#/properties/pull_request/additionalProperties",
"params": {
"additionalProperty": "active_lock_reason"
},
"message": "should NOT have additional properties"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"review_request_removed"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"review_requested"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"synchronize"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"unassigned"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"unlabeled"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "enum",
"dataPath": "/action",
"schemaPath": "#/properties/action/enum",
"params": {
"allowedValues": [
"unlocked"
]
},
"message": "should be equal to one of the allowed values"
},
{
"keyword": "oneOf",
"dataPath": "",
"schemaPath": "#/oneOf",
"params": {
"passingSchemas": null
},
"message": "should match exactly one schema in oneOf"
}
]
}
Instead of listing all possibilities in multiple errors for the action
property, list them all in one, since allowedValues
is an array
New dev dependency: ajv-formats
I introduced a dev dependency on ajv-formats
in octokit/webhooks#317
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.