Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Schema Inaccuracy] Missing additionalProperties=true of deployment's payload in webhooks #4421

Open
msw-kialo opened this issue Jan 9, 2025 · 0 comments
Labels

Comments

@msw-kialo
Copy link

Schema Inaccuracy

The payload field of deployments in the API schema is typed as {'oneOf': [{'type': 'object', 'additionalProperties': True}, {'type': 'string'}]} to allow a (JSON) object directly or encoded as string.

However, the webhook that include deployments (deployment-created and deployment-status-created) are only typed as {'oneOf': [{'type': 'object'}, {'type': 'string'}]}. The missing additionalProperties means that only empty objects are allowed.

However, the webhook delivered by GitHub return the payload the deployments was created with (with can be objects with additional keys).

Expected

The webhook schemas:

  • components.schemas.webhook-deployment-created.properties.deployment.properties.payload
  • components.schemas.webhook-deployment-status-created.properties.deployment.properties.payload

should declare "additionalProperties": true as the api definitions already do:

  • paths./repos/{owner}/{repo}/deployments.post.requestBody.content.application/json.schema.properties.payload
  • components.schemas.deployment.properties.payload

Reproduction Steps

Create a deployment with object payload, e.g.

    "payload": {
      "downtime": false,
    }

inspect the webhook response. It does return the same value. The payload includes more fields (downtime) than documented, but additionalProperties is the default false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants