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

Redoc.init callback not working on error #2233

Open
broccolism opened this issue Dec 9, 2022 · 4 comments
Open

Redoc.init callback not working on error #2233

broccolism opened this issue Dec 9, 2022 · 4 comments

Comments

@broccolism
Copy link

broccolism commented Dec 9, 2022

Describe the bug
Callback function registered on Redoc.init is not called on error while rendering redoc.

Redoc.init(
  event.data,
  config,
  document.getElementById('redoc-container'),
  callback ---> doesn't seem to be called.
);

If something's wrong in my code, please tell me how to apply callback function on error.

Expected behavior
Callback function should be called on error.
image

Minimal reproducible OpenAPI snippet(if possible)

Screenshots
image

Additional context
Add any other context about the problem here.

@RomanHotsiy
Copy link
Member

I believe this functionality was lost during rewriting this to React a while ago.

PR would be appreciated!

@broccolism
Copy link
Author

broccolism commented Dec 29, 2022

@RomanHotsiy Hi! Thanks for checking this issue.
I found #2195 and https://github.com/Redocly/redoc/pull/2182/files which fixed this bug on Oct 21,
but I also found the source code of the latest version (Release 2.0.0, Sep 13) does not have those lines to call onLoaded function.
Is this what you said?

@RomanHotsiy
Copy link
Member

Yeah, this is the reason most likely.

I wander why those lines were removed. Would be cool to find it in git history.

@broccolism
Copy link
Author

broccolism commented Dec 30, 2022

@RomanHotsiy Since I'm new here so it could be wrong, but I guess
this PR accidentally removed them.😂

Anyways, they seem to be came back on current main branch so I think it would be fixed on next release.
Can you tell me when is the next release? My team is using redoc and we really need this callback function. Thanks.

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

No branches or pull requests

2 participants