Skip to content

Bug in definition of callbacks #1856

@ThomasR

Description

@ThomasR

I'm talking about the callbacks field callbacks :== Map[string, Callback Object | Reference Object]

The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.

both defined in
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject
and
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject

This means that this is a valid callbacks map:

callbacks:
  "$request.query.queryUrl": # key value used to identify the callback object
    <CallbackObject>
  "$url":  # key value used to identify the callback object
    <CallbackObject>

Now, by definition of a Callback Object:

The key that identifies the Path Item Object is a runtime expression that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#key-expression

so we end up with some mess like this:

callbacks:
  "$request.query.queryUrl": # key value used to identify the callback object
    "$request.query.queryUrl": # key that identifies the Path Item Object
      <PathItemObject>
    "$url": # key that identifies the Path Item Object
      <PathItemObject>
  "$url":  # key value used to identify the callback object
    "$request.query.queryUrl":  # key that identifies the Path Item Object
      <PathItemObject>
    "$url": # key that identifies the Path Item Object
      <PathItemObject>

This makes no sense to me and I'm assuming it's a bug. Reading through #1141, I think that the intention was to make this example valid

callbacks:
  "foo":
    <CallbackObject>
  "bar":
    <CallbackObject>

but it's not, because the literals "foo", "bar" are not runtime expressions.

Metadata

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