Skip to content

Conversation

@valerii15298
Copy link
Contributor

According to https://spec.openapis.org/oas/v3.2.0.html#callback-object the type is Path Item Object

Screenshot 2025-12-25 at 11 14 28 AM

Also I noticed that all names of types correspond to names from the spec without Object suffix, but Callbacks is plural while in the spec it is called Callback, so maybe change that to for consistency?

I am actually surprised that specs does not allow Referece Object inside a callback map, but it is what it is, maybe they will allow it in the next version.

};

type Callbacks = Record<string, PathItem | Reference>;
type Callbacks = Record<string, PathItem>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callbacks is supposed to be the type for the "callbacks" field Components and Operations. I think what's actually needed is this,

Suggested change
type Callbacks = Record<string, PathItem>;
type Callback = Record<string, PathItem>;
type Callbacks = Record<string, Callback | Reference>;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second look, I think you're right. I got confused because of the naming like you said. So, ignore my suggestion and let's stick with the change you suggested including renaming Callbacks to Callback.

@jdesrosiers jdesrosiers merged commit 89441f4 into hyperjump-io:main Jan 4, 2026
2 checks passed
jdesrosiers added a commit that referenced this pull request Jan 19, 2026
* Remove Reference type from Callbacks definition

* Rename Callbacks to Callback

* Make the same Callback fix for OpenAPI 3.1

---------

Co-authored-by: Jason Desrosiers <jdesrosi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants