Skip to content

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

Open
@msw-kialo

Description

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.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions