Skip to content

Webhook : wrong example no path defined #3449

@LasneF

Description

@LasneF

according to the documentation web hooks are defined like this

webhooks Map[string, Path Item Object | Reference Object] ] The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available.

but in the official sample presents i think a really corner case , i am not even sure it is valid

as here we have webhook , a string here newPet , but so far no path object , just a post operation

whereas i think we should have a path mentionning that would go to /pet/ meaning that the implementer of the webhook must implements /pet/ with the describe payload

here the sample looks minimalistic not even sure it works does the implementer need to implements just post on the root

to me the sample does not looks here

the comment in the files
https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.1/webhook-example.yaml

saying ' This is a Path Item Object ' is unclear as it is describing only a verb not a path

openapi: 3.1.0
info:
  title: Webhook Example
  version: 1.0.0

webhooks:
  // Each webhook needs a name
  newPet:
    // This is a Path Item Object, the only difference is that the request is initiated by the API provider
    post:
      requestBody:
        description: Information about a new pet in the system
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pet"
      responses:
        "200":
          description: Return a 200 status to indicate that the data was received successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions